Re: error handling when updating a datasource via a data adapter

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Joyjit Mukherjee (joyjit_mukherjee_at_hotmail.com)
Date: 09/07/04


Date: Tue, 7 Sep 2004 10:43:08 +0530

Hi,

trap the DataAdapters RowUpdated event, theres a Error property which is a
exception object that you can look for the type of error.

HTH
Regards
Joyjit

"matthew c. harad" <matthewcharad@discussions.microsoft.com> wrote in
message news:41F256C1-C215-42D3-BB04-CED6C1EFDCAE@microsoft.com...
> i'm updating a table using a data adapter and stored procedure as it's
> insert/update commands.
>
> in certain cases, i would like the stored procedure to throw an exception
> and fail -- or just return an error, and then i want to catch the
exception
> at the .net application layer.
>
> how is the best way to handle this? i don't mind if the entire update
> fails, rather than just one of the updated rows in the dataset. i would
just
> like to handle it simply. i wasn't successful with the docs on this one.
>
> much appreciated,
> matthew



Relevant Pages

  • Re: Exception in property in Windows Forms DataBinding
    ... - Im binding a text box to a custom ... to establish that an error has been thrown and indicating this in an ... >> What i meant was that instead of throwng an exception you should set the ... >> error property in the IDataErrorInfo interface, ...
    (microsoft.public.dotnet.framework.windowsforms.databinding)
  • Re: Exception in property in Windows Forms DataBinding
    ... > What i meant was that instead of throwng an exception you should set the ... > error property in the IDataErrorInfo interface, ... >> ErrorProvider. ...
    (microsoft.public.dotnet.framework.windowsforms.databinding)
  • Re: customizing validation script-injection error page.
    ... All exceptions can be captured in two places, using event handlers: ... Page object has the Error property ... Your task is to test the class of exception object and redirect to the ... and "Visual Input Security" at http://www.peterblum.com/vise/home.aspx ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: error handling when updating a datasource via a data adapter
    ... Regards ... > handler for that event. ... >> trap the DataAdapters RowUpdated event, theres a Error property which is ... >> exception object that you can look for the type of error. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Timeout on populating a datagrid
    ... I'd review the stored procedure SQL in a query tool and see how long ... An unhandled exception occurred during the execution of the ... >Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior ...
    (microsoft.public.dotnet.framework.aspnet)