PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Storedprocedure runs in " Query Analyzer" but not from within C# program.
Forums
Newsgroups
Microsoft DotNet
Microsoft ADO .NET
Storedprocedure runs in " Query Analyzer" but not from within C# program.
![]() |
Storedprocedure runs in " Query Analyzer" but not from within C# program. |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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"); |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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"); |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

