473,325 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

will a client application using ado.net get an exception if the command is executing a stored procedure that does a RAISEERROR in its tsql?

will a client application using ado.net get an exception if the command is
executing a stored procedure that does a RAISEERROR in its tsql?
Feb 2 '06 #1
5 2028
Daniel,

Well, you could try it very easily (and probably have it done in the
time it took for you to get this response).

But the answer is yes. =) It should throw a SqlException.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Daniel" <so*******************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
will a client application using ado.net get an exception if the command is
executing a stored procedure that does a RAISEERROR in its tsql?

Feb 2 '06 #2
Yes.

--
Dale Preston
MCAD C#
MCSE, MCDBA
"Daniel" wrote:
will a client application using ado.net get an exception if the command is
executing a stored procedure that does a RAISEERROR in its tsql?

Feb 2 '06 #3
Actually, a little more thorough answer. Yes. The client will get a
SqlException with SqlException.Number set to 50000 by default or whatever you
set your error number to in your call to RAISERROR.
--
Dale Preston
MCAD C#
MCSE, MCDBA
"Daniel" wrote:
will a client application using ado.net get an exception if the command is
executing a stored procedure that does a RAISEERROR in its tsql?

Feb 2 '06 #4
As an fyi, if you get an error with a lower severity number, you can trap it
with the infomessage event:
http://www.knowdotnet.com/articles/connections.html
"Daniel" <so*******************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
will a client application using ado.net get an exception if the command is
executing a stored procedure that does a RAISEERROR in its tsql?

Feb 2 '06 #5
Very interesting article. I wasn't familiar with the infomessage event
before. I'll have to look for an opportunity to try it out.
--
Dale Preston
MCAD C#
MCSE, MCDBA
"W.G. Ryan - MVP" wrote:
As an fyi, if you get an error with a lower severity number, you can trap it
with the infomessage event:
http://www.knowdotnet.com/articles/connections.html
"Daniel" <so*******************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
will a client application using ado.net get an exception if the command is
executing a stored procedure that does a RAISEERROR in its tsql?


Feb 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: mountain man | last post by:
Greetings to all database professionals and laymen, Let us make a bold assumption that we have developed a software tool for the SQL Server environment which simply acts as an interface between...
11
by: randi_clausen | last post by:
Using SQL against a DB2 table the 'with' key word is used to dynamically create a temporary table with an SQL statement that is retained for the duration of that SQL statement. What is the...
4
by: Stuart Ferguson | last post by:
I am currently writing code to execute SQL Server 2000 Stored procedured using the ODBC.NET SQL Server Driver. The particular stored procedure I am using has multiple paramaters which I have...
0
by: Mike | last post by:
Hi, I am trying to insert parameters into a stored procedure using DAAB (see code at the bottom of this post). I am getting the following error: Object reference not set to an instance of an...
7
by: Ralf Gedrat | last post by:
Hello! I have some Vb.Net applications, which are terminated at indefinite times without message. If I call in the program regulated system.GC.Collect, then the program is terminated here...
0
by: Daniel | last post by:
will a client application using ado.net get an exception if the command is executing a stored procedure that does a RAISEERROR in its tsql?
5
by: Sridhar | last post by:
Hi, I have created a web application. I have a data access dll to interact with database. I added this dll as a reference to the web application. Now let's say if I am calling a function in data...
13
by: Filips Benoit | last post by:
Dear All, How can I show the resultrecords of a SP. I can be done by doubleclick the SPname? But how to do it by code. I want the following interface In my form the user 1 selects a SP...
9
by: Ryan Liu | last post by:
Hi, I use C# wrote an Client/Server application. In production environment, will be 130 clients (Windows XP) connect to a Server (Windows 2000/2003 Server) thought TCP/IP socket in a local 100M...
4
by: smartin | last post by:
Hi, I'm having problem retrieving data from an SQL stored procedure. I tried debugging but it wont give a the reason for the error. it just throws an exception after executing cmd.ExecuteNonQuery...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.