PC Review


Reply
Thread Tools Rate Thread

Displaying SQL 2008 info and error mesages on the web page

 
 
NeilR
Guest
Posts: n/a
 
      31st Jul 2009
We have a series of list pages on our ASP.NET 3.5 website for
displaying various searchable lists from our SQL 2008 database. The
master page for these pages has a message box for us to display
messages from the SQL stored procedures, and this works fine when we
use add, update or delete SPs, as ther only return is the message (eg
"Added as CompanyID 1234567"). However, we would like to use it for
messages that come back WITH lists too - eg to show "This person
already has the email addresses shown above. Press ADD to add another
email address". We use the sqlDataAdapter to get the list of existing
email addresses but this does not seem to enable us to get a return
infomessage from the SP. Can anyone post some code or point us to any
guidance on how to get the retrun message as well as the datalist from
the SP? I have searched SQL, ADO and ASP.NET resources but cannot find
a simple example of doing this. If you can also add a few words about
the SQL connection object InfoMessage Event it would be even more
helpful!
Many thanks, Neil
 
Reply With Quote
 
 
 
 
William Vaughn \(MVP\)
Guest
Posts: n/a
 
      31st Jul 2009
I'm not sure what you've tried, but the InfoMessage Event should fire when
the sp executes a PRINT statement or RAISEERROR. Note that these events do
NOT fire on the client until the TDS packets containing this feedback
arrive--and they arrive AFTER the rowset has arrived. If you have multiple
resultsets, they might not appear until after all resultsets have arrived.

See Chapter 11 pages 720-724 in my book FMI.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
http://betav.com http://betav.com/blog/billva
____________________________________________________________________________________________



"NeilR" <(E-Mail Removed)> wrote in message
news:a0b55c45-8315-4e54-804c-(E-Mail Removed)...
> We have a series of list pages on our ASP.NET 3.5 website for
> displaying various searchable lists from our SQL 2008 database. The
> master page for these pages has a message box for us to display
> messages from the SQL stored procedures, and this works fine when we
> use add, update or delete SPs, as ther only return is the message (eg
> "Added as CompanyID 1234567"). However, we would like to use it for
> messages that come back WITH lists too - eg to show "This person
> already has the email addresses shown above. Press ADD to add another
> email address". We use the sqlDataAdapter to get the list of existing
> email addresses but this does not seem to enable us to get a return
> infomessage from the SP. Can anyone post some code or point us to any
> guidance on how to get the retrun message as well as the datalist from
> the SP? I have searched SQL, ADO and ASP.NET resources but cannot find
> a simple example of doing this. If you can also add a few words about
> the SQL connection object InfoMessage Event it would be even more
> helpful!
> Many thanks, Neil


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Additional question regarding Web page not displaying info correct Stever Microsoft Frontpage 1 25th Sep 2009 11:00 PM
Linking worksheets with main page, not displaying required info Pete in Sydney Microsoft Excel Crashes 0 22nd May 2008 07:44 AM
Warning Mesages on Data Access Page =?Utf-8?B?S2ltIFJhd2xpbmdz?= Microsoft Access 4 20th Aug 2005 11:43 PM
Text Mesages not displaying Tony Hicks Microsoft Outlook Discussion 1 5th Jan 2004 04:02 PM
displaying spreadsheet info on a web page dynamically Andrew Microsoft Excel Misc 1 19th Jul 2003 11:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:52 PM.