-
ExecuteNonQuery return value
Dear All,
How can I get the actual error code or message when ExecuteNonQuery is executed?
We can check the status of the ExecuteNonQuery by the return value indicating
number of row affected. If an error occurred, the return value is 0, but
what is the actual error that causing it? Thanks in advance.
Regards,
Steve.
-
Re: ExecuteNonQuery return value
You should of gotten an exception if there was an error.
if you have
try{
DataThing.ExecuteNonQuery();
}
catch{
}
you won't see it versus
try{
DataThing.ExecuteNonQuery();
}
catch{System.Data.SQLorOracleClient.SQLorOracleException Exception) {
MessageBox.Show(Exception.Message.ToString());
}
SqlException has a number property you can check.
"Steve" <vb.@127.0.0.1> wrote in message
news:3e8129d0$1@tnews.web.devx.com...
>
> Dear All,
> How can I get the actual error code or message when ExecuteNonQuery is
executed?
> We can check the status of the ExecuteNonQuery by the return value
indicating
> number of row affected. If an error occurred, the return value is 0, but
> what is the actual error that causing it? Thanks in advance.
>
> Regards,
> Steve.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks