By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,249 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Sql Server messages

P: n/a
I have a stored procedure that I run from an asp.net application that
simply backs up a very small Sql Server database. If I run the stored
procedure in Query Analyzer, there is a server message returned
letting me know that the database was backed up successfully. I want
to be able to return this message in the asp.net application for
display on the screen because it contains some other useful
information. Does anyone know how to return the server message. Thanks
in advance.

-Rob
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi Rob:

Add an event handler for the InfoMessage event on the SqlConnection
used to execute the stored procedure. The messages will arrive there
after the query completes.

HTH,

--
Scott
http://www.OdeToCode.com

On 7 May 2004 12:26:26 -0700, ro*********@wbp.org (Robert Bull) wrote:
I have a stored procedure that I run from an asp.net application that
simply backs up a very small Sql Server database. If I run the stored
procedure in Query Analyzer, there is a server message returned
letting me know that the database was backed up successfully. I want
to be able to return this message in the asp.net application for
display on the screen because it contains some other useful
information. Does anyone know how to return the server message. Thanks
in advance.

-Rob


Nov 18 '05 #2

P: n/a
Rob

Worked great Scott...thanks a lot.

-Rob
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #3

P: n/a
CT
In addition to Scott's reply, messages with a severity level of 19 or more,
will throw an exception in your code.

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Robert Bull" <ro*********@wbp.org> wrote in message
news:bf**************************@posting.google.c om...
I have a stored procedure that I run from an asp.net application that
simply backs up a very small Sql Server database. If I run the stored
procedure in Query Analyzer, there is a server message returned
letting me know that the database was backed up successfully. I want
to be able to return this message in the asp.net application for
display on the screen because it contains some other useful
information. Does anyone know how to return the server message. Thanks
in advance.

-Rob

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.