PC Review


Reply
Thread Tools Rate Thread

Storedprocedure runs in " Query Analyzer" but not from within C# program.

 
 
Marmarus
Guest
Posts: n/a
 
      25th Aug 2003
I have a stored procedure that updates several tables with data from
temporary tables.

In the non temporary tables I have AutoNumber's (Idents) and I don't
allow duplicates so I uses Cursors, fetch, insert into and @@Identity.
In Query Analyzer everything goes as planed the cursor goes thou the
source table and inserts data in table1 and I get the @@Identity
insert data in table2 and I get the @@Identity insert data in table3.
If I have a doublet I'll receive a message and doesn't insert the
values in the other tables.

But when I runs this from within my C# the execution stops instead of
continuing.


The c# code looks something like this
SqlConnection connectionValue = new SqlConnection(ConnString);
SqlCommand command = new SqlCommand("rexp_UpdateDumpData",
Connection);
command.CommandType = CommandType.StoredProcedure;

Adapter.SelectCommand = command;
rowsAffected = Adapter.Fill(DataSetToReturn, "tbImportErrors");
 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      25th Aug 2003
The Fill method is used to retrieve data, not update it.

"Marmarus" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a stored procedure that updates several tables with data from
> temporary tables.
>
> In the non temporary tables I have AutoNumber's (Idents) and I don't
> allow duplicates so I uses Cursors, fetch, insert into and @@Identity.
> In Query Analyzer everything goes as planed the cursor goes thou the
> source table and inserts data in table1 and I get the @@Identity
> insert data in table2 and I get the @@Identity insert data in table3.
> If I have a doublet I'll receive a message and doesn't insert the
> values in the other tables.
>
> But when I runs this from within my C# the execution stops instead of
> continuing.
>
>
> The c# code looks something like this
> SqlConnection connectionValue = new SqlConnection(ConnString);
> SqlCommand command = new SqlCommand("rexp_UpdateDumpData",
> Connection);
> command.CommandType = CommandType.StoredProcedure;
>
> Adapter.SelectCommand = command;
> rowsAffected = Adapter.Fill(DataSetToReturn, "tbImportErrors");



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query runs manually, fails from Outout TO (excel) with "Too ManyFields" Phil Smith Microsoft Access Macros 4 31st Jul 2009 09:58 PM
Query Runs For Awhile, Then Pops "Invalid Argument"? (PeteCresswell) Microsoft Access 2 11th May 2007 09:08 PM
Attempting to Create a "Top N Values Per Group" Query Runs Unexpec =?Utf-8?B?T3JsYW56bw==?= Microsoft Access Queries 5 7th Jul 2006 06:58 PM
What Program runs a "tgcmd module" in the c: drive? =?Utf-8?B?U2Ft?= Windows XP General 1 23rd Jun 2006 08:31 AM
Autostart runs "C:Program" lunberg Windows XP General 1 12th Jul 2003 07:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:31 PM.