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

  • Thread starter Thread starter Marmarus
  • Start date Start date
M

Marmarus

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");
 
Back
Top