Re: What SqlExceptions can be thrown
- From: "Diane Droubay" <Diane Droubay@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 15 Jun 2005 13:09:03 -0700
Thanks. So, it would be safe to assume that for some reason or another that
my stored procedure failed, and I could just log it and deal with the
failure. There is no case where a SqlException exception would be
informational, but not indicate a complete failure?
Diane
"Nicholas Paldino [.NET/C# MVP]" wrote:
> Diane,
>
> If all you need to know is if the stored procedure you ran completed
> successfully, then all you have to do is determine whether or not there was
> an exception, if not, then the command succeeded.
>
> As for what SqlExceptions might be thrown, the SqlException class will
> have more information based on the specific errors that SQL server returns.
> In the end though, it's that one exception that is thrown, with additional
> information.
>
> Is there a particular error that you are trying to catch from SQL
> server? If so check the Errors property on the exception instance and then
> look at the Number property of the individual errors, checking against the
> specific errors you are looking for.
>
> Hope this helps.
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> - mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
>
>
> "Diane Droubay" <Diane Droubay@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:5366CCD9-7EB8-435F-8441-B442D44A4679@xxxxxxxxxxxxxxxx
> > to my application?
> >
> > In my web service, I'm using the Sql Data provider for .NET. I put the
> > code
> > that sets up parameters, my call to Connection.Open(), and to
> > Command.ExecuteNonQuery() in a try block, then catch SqlException.
> >
> > The problem is, I have been unable to determine what SqlExceptions might
> > be
> > thrown to my app, and what they might mean. Specifically, I need to know
> > whether or not the stored procedure I just ran executed successfully. Is
> > there any place I can look this up?
> >
> > Thanks in advance.
> >
> >
>
>
>
.
- Follow-Ups:
- Re: What SqlExceptions can be thrown
- From: Jon Skeet [C# MVP]
- Re: What SqlExceptions can be thrown
- References:
- What SqlExceptions can be thrown
- From: Diane Droubay
- Re: What SqlExceptions can be thrown
- From: Nicholas Paldino [.NET/C# MVP]
- What SqlExceptions can be thrown
- Prev by Date: Re: MD5 or other checksum
- Next by Date: Re: Excel Object Library(s)??
- Previous by thread: Re: What SqlExceptions can be thrown
- Next by thread: Re: What SqlExceptions can be thrown
- Index(es):
Relevant Pages
|
Loading