SqlDataAdapter Not Catching SQL Exceptions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a SqlDataAdapter that is not picking up Sql exceptions from the SQL Server database such as foreign key constrain violations. When I call the update method of the dataadapter for either inserts or updates, it just fails silently. If I do the update directly from the SQL table the errors are being generated by the server. The ContinueUpdateOnError property for my adapter is set to false. The adapter was picking up SQL exceptions just fine earlier, so I must have changed something by accident. I have another adapter in my project that is picking up exceptions just fine, so it is not of application wide scope

Does anyone have any idea what might be causing this behavior? Any help would be greatly appreciated.
 
If ContinueUpdateOnError is set to false (this would have been my first
guess) then is your code wrapped in a try catch that may not be doing
anything once it catches teh exception? Also, are you sure that the db is
raising errors? I know this may sound silly, but are you sure the Update
statement is firing against the db and that the dataset .HasChanges?

If so, then can you post the code, it might be easier to discern then..

Bill
Manch said:
I have a SqlDataAdapter that is not picking up Sql exceptions from the SQL
Server database such as foreign key constrain violations. When I call the
update method of the dataadapter for either inserts or updates, it just
fails silently. If I do the update directly from the SQL table the errors
are being generated by the server. The ContinueUpdateOnError property for
my adapter is set to false. The adapter was picking up SQL exceptions just
fine earlier, so I must have changed something by accident. I have another
adapter in my project that is picking up exceptions just fine, so it is not
of application wide scope.
Does anyone have any idea what might be causing this behavior? Any help
would be greatly appreciated.
 
Back
Top