Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
lionee
Starting Member
2 Posts |
Posted - 2007-09-07 : 15:37:45
|
I can not figure out whats going onI have a stored procedure:set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgoALTER PROCEDURE [dbo].[spInsertSpaceItem]( @SpaceItemID int)AS RAISERROR('ERROR' 11,1) basically it does nothing but throw an error. I have a dataAdapter with an update and an Insert Command. Both Commands are set to the same command, and this same stored procedure. If I have an updated record in my table it throws the error, BUT if I have an added record in my table it does NOT throw an exception! Is the dataAdapter supressing it or what?Thanks for any help on thislionee |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-09-07 : 15:58:46
|
Moving this to the .NET forum since this is more of a question on the client side.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
|
|
lionee
Starting Member
2 Posts |
Posted - 2007-09-07 : 16:09:55
|
I found it, we have a line of code in our class to not update inserted records:private void OnRowUpdated(object sender, SqlRowUpdatedEventArgs e) {if ( e.StatementType == StatementType.Insert )e.Status = UpdateStatus.SkipCurrentRow;}this line supressed the database exception. |
|
|
|
|
|