Showing posts with label luck. Show all posts
Showing posts with label luck. Show all posts

Monday, March 26, 2012

External DataSet on GoDaddy

Hello,
First, I tried to find the answet to this question, but no luck - so I decided to post it.

When I was creating my applications in asp.net - for the first time I decided to start using external DataSets. I think they are great and work very nice!

But once I pushed the application to GoDaddy, I got an error of this nature:
I was trying to access the exterbal dataSet like this:

Dim productsAdapter As NewNorthwindTableAdapters.ProductsTableAdapter()Dim products as Northwind.ProductsDataTable
...
And got an error saying that it couldn't find this type (but it worked fine on my local machine in visual studio).
So did I miss something that prevented this application working on GoDaddy? or there are some limitations on GoDaddy? ...or something else.
Thank you for looking into this for me.
Valera

I think Godaddy uses SQL 2000, so did you setup your connection strings in your web.config to connect to your Database on the GoDaddy server?

|||

I'm pretty sure it uses SQL Server 2005. And the connection string was setup correctly, becuase I can get access to the data without using external dataSet methods.

If anyone with the access to Godaddy could create a sample page that uses external dataset data access method and prove me worng or right - that would be helpful.

Thank you

|||

You are correct about 2005. When I first signed up in 2005, they were using SQL 2000.

Maybe I am a noob, but you say external dataset, how is that different from a regular dataset?

|||

By external DataSet I mean that in your project you can add a new item - DataSet (just like a web form) that will be stored in App_Code folder. It is very well described here:http://www.asp.net/learn/dataaccess/tutorial01vb.aspx?tabid=63

|||

Oh, I am very fimilar with Scott's tutorials, they are excellent. I would not suggest using 'Strongly typed Dataset'. I didn't realize that is what you meant. Custom entities (A true database class) are far superior for scalability.

In Godaddy, is your ASP.NET runtime set to 2.0?

|||

Yes ser - 2.0 it is :]

|||

Could you take a screenshot of the error and and upload it to imageshack or some site and post it here. (block out sensitive data)

I am assuming you are trying to rebuild Scott's tutorial, correct?

Sunday, February 19, 2012

Exporting to multiple files from a single source table using DTS

Hi Friends

I have been trying to solve this problem for the last 2 days but no luck.

Here is the problem that I am facing.

The task on had is to transfer data from a single table (the source) to multiple files (Destination) based on the record type.

I have tried to changing the Datasource property of the Text File Connection object dynamically by using an ActiveX Script. But the data is still being written only to one file.

Can anyone please help me.

Thanks in advance.

Srinivas.Can't you split up your export by using views with restrictions on your recordtype instead of your table?|||manthenasri, does DTS allow you to redirect output on the fly? From what I have seen the source and destination is fixed at design time.

Have you tried BCP with a query? You could use DTS to script your BCP commands to a CMD file. Then at the cmd prompt you could use DTSRUN to build the CMD file and then execute the CMD file. Or just set up a procedure to script the BCP commands and use xp_cmdshell.

Sort of bassackwards but it's the best I could come up with.|||Hello Paul

I do not know much about BCP. But here is the problem that i have to solve.

I have a table by name T1 which has the following data

Business Unit Name SSN RATE
1 Joe 923456789 40
1 Jenny 568234569 50
3 Mike 234198634 35
3 Meri 743579374 45

Now i need to create a two files by name 1.ben and 3.ben on the fly.
and them put in the data related to Joe and Jenny into 1.ben and the data for Mike and Meri into 3.ben. If there is more data related to other business units i need to create those files also.

Can you please tell me how i can accomplish using BCP.

Thanks,
Srinivas.|||I think the BCP command you want is...

bcp "select * from <dbname>.<owner>.<table> where <where clause>" queryout <file name> -c -T -S <server>

probably could wrap it all up like this:
create table manthenasri([Business Unit] int, [Name] varchar(15), SSN varchar(9), Rate int)
insert into manthenasri values(1,'Joe','923456789',40)
insert into manthenasri values(1,'Jenny','568234569',50)
insert into manthenasri values(3,'Mike','234198634',35)
insert into manthenasri values(3,'Meri','743579374',45)

declare @.bu int, @.TSQL varchar(255)
select @.bu = min([Business Unit]) from manthenasri
while @.bu is not null begin
set @.TSQL = 'bcp "select * from ' + db_name() + '..' + 'manthenasri where [Business Unit] = ' + cast(@.bu as varchar) + '" queryout ' + cast(@.bu as varchar) + '.ben -c -T -S ' + @.@.servername
print @.TSQL
-- master.dbo.xp_cmdshell(@.TSQL)
select @.bu = min([Business Unit]) from manthenasri where [Business Unit] > @.bu
end

Open Query Analyzer and run the above code. It should produce a few BCP commands. Make adjustments for your table and rerun the script. Next try cutting and pasting the results to a CMD prompt and see how it works. Once that's done you can un-comment the xp_cmdshell call and try running this on your server.

THIS IS UNTESTED CODE!

Look this over and post back with questions.|||Hi Srinivas ,

Use DTS designer add one data pump task for each condition and output file.

For example : Use select statement as the source of data pump task with where clause and desination to the the disired out put file.

cheers :)

Shaji

Originally posted by manthenasri
Hi Friends

I have been trying to solve this problem for the last 2 days but no luck.

Here is the problem that I am facing.

The task on had is to transfer data from a single table (the source) to multiple files (Destination) based on the record type.

I have tried to changing the Datasource property of the Text File Connection object dynamically by using an ActiveX Script. But the data is still being written only to one file.

Can anyone please help me.

Thanks in advance.

Srinivas.|||Hai Paul


Thank you for the BCP solution that you have given. I really appreciate you patience in giving me a sample program also.

The sample worked just fine except for the brackets enclosing the variable @.Tsql. I think these brackets should not be there. I had to remove these brackets.

But now have a problem of reading from multiple files and posting that data into table. I have to do an isert and also an update on the table. How can i do that?

Thank you very much once again.

Srinivas.