473,221 Members | 1,713 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,221 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 2023
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.