PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET Storedprocedure runs in " Query Analyzer" but not from within C# program.

Reply

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

 
Thread Tools Rate Thread
Old 25-08-2003, 04:25 PM   #1
Marmarus
Guest
 
Posts: n/a
Default Storedprocedure runs in " Query Analyzer" but not from within C# program.


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
Old 25-08-2003, 04:53 PM   #2
Marina
Guest
 
Posts: n/a
Default Re: Storedprocedure runs in " Query Analyzer" but not from within C# program.

The Fill method is used to retrieve data, not update it.

"Marmarus" <marmarus@hotmail.com> wrote in message
news:cd7308b5.0308250625.3ef954a9@posting.google.com...
> 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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off