Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Catching an error from the database
Message
From
17/09/2008 09:52:46
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
16/09/2008 00:51:29
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
VB 9.0
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01347819
Message ID:
01348211
Views:
19
Hi Stuart,

>Hi
>I have two databases, if the first database rejects a record, I want to send the record to the second database and carry on to the next record without reporting an error. How do I do this?
>At the moment i have it set up as below, but it still stops and reports and error back.
>
>In the dataAccess class I have removed the catch try around the following line, (if I leave it nothing happens)
>
>   RowsUpdated = DataAdapter.Update(ds, ds.Tables[tableName].ToString());
>
>In my business object I have the following
>
>       public override void HandleException(Exception e)
>        {
>            base.HandleException(e);
>            this.ExceptionHandled = true;
>            this.writeToBaddb(e);
>          
>        }
>
>
>TIA
>Stuart
>p.s. I do not have control over the database, and there are various triggers to other databases with rules, so I do not know the rules of whats being rejected before hand


Are the two databases the same type as in both SQL server? Is the failure you are referring to due to constraints on the table? Also can you explain what you mean by "If I leave it nothing happens"? I assume you are referring to the Try/ Catch but what do you mean nothing happens; have put in a breakpoint to see this occur?
Tim
Timothy Bryan
Previous
Reply
Map
View

Click here to load this message in the networking platform