473,786 Members | 2,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.net + Retriving MS SQL Messages

Hi There,

I have written an SQL script which i run though a VB.net application. It has
some print statements in which print results of the Script to the message
window if you run the script in the Query Analyser. Is there a way or getting
these messages in vb.net. Ive had a look round but no one seems to have done
it before. I suppose i could just write the results to another table, but i
like the idea of trying to capture the messages.

Hope someone can help me out.

Reagrds

James
Nov 21 '05 #1
2 7427
Hi,

Maybe this will help.
http://msdn.microsoft.com/library/de...ldebugging.asp

Ken
-------------------------
"James Proctor" <Ja**********@d iscussions.micr osoft.com> wrote in message
news:C6******** *************** ***********@mic rosoft.com...
Hi There,

I have written an SQL script which i run though a VB.net application. It has
some print statements in which print results of the Script to the message
window if you run the script in the Query Analyser. Is there a way or
getting
these messages in vb.net. Ive had a look round but no one seems to have done
it before. I suppose i could just write the results to another table, but i
like the idea of trying to capture the messages.

Hope someone can help me out.

Reagrds

James
Nov 21 '05 #2
Bob
Handle the the InfoMessage event in the SqlConnection object and have at
look at e.Errors.

Public WithEvents cn As SqlConnection

Private Sub cn_InfoMessage( _
ByVal sender As Object, _
ByVal e As System.Data.Sql Client.SqlInfoM essageEventArgs _
) Handles cn.InfoMessage
For Each err As System.Data.Sql Client.SqlError In e.Errors
If err.State = 1 Then
'not an error, an info message
Else
'State <> 1 means it really is an error
End If
Next
End Sub

This will capture any PRINT statements you put in stored procedures or
triggers, which can be very, very useful for debugging. I put descriptive
PRINT statements in most of my triggers.

HTH,
Bob

"James Proctor" <Ja**********@d iscussions.micr osoft.com> wrote in message
news:C6******** *************** ***********@mic rosoft.com...
Hi There,

I have written an SQL script which i run though a VB.net application. It has some print statements in which print results of the Script to the message
window if you run the script in the Query Analyser. Is there a way or getting these messages in vb.net. Ive had a look round but no one seems to have done it before. I suppose i could just write the results to another table, but i like the idea of trying to capture the messages.

Hope someone can help me out.

Reagrds

James

Nov 21 '05 #3

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

Similar topics

1
1374
by: serge calderara | last post by:
Dear all, I am retriving the atribute of an assembly by using : obj = System.Reflection.Assembly.LoadFrom (sFile).GetCustomAttributes(True) Then fetching attribute object as folllow: Description = CType(assAttribute,
8
3770
by: Alpha | last post by:
I created the following code in my C# program but it's giving me error message at run time of : XML.XPATH.XPATHEXCEPTION : Namespace Manager or XSLTContext needed. This query has a prefix, variable or user defined function. Can someone see what I'm doing wrong? Thanks, Alpha private XPathDocument unityMessages = new XPathDocument("UnityMessages.xml");
2
3098
by: balakrishnan.dinesh | last post by:
Hi frnds, Im having a problem with retriving "\" backslash , In my javascript client side page , ill get the response from the server side , the response will contain some url like "\bank\index.htm" . So what i have to do is, ill get those url and display them in textfields , The problem is , while retriving the url , the backslashes are missing , for some backslashes its generating junk values like box
1
2590
by: Kunal Nandi | last post by:
can any one give me the code for uploading and retriving image using Blob, with jsp at front end and oracle8i at the back end ??????? i have tried this using long raw datatype i was able to upload it, but while retriving first i have to create a temporary image file for that. and then i m able to retirve it on the web page, but i want it to be directly retrived on the web page.
2
1662
by: soma.gunasekaran | last post by:
Hi All , I've stored the Image file..... But i want to retriving the Image files from MSACCSS 2003 (JPEG,bmp,Gif and etc....) So Pls help me........ help me............... Thanking you, Somasundaram G
6
1535
by: kavithadevan | last post by:
Hi, I am trying to retriving some datas from the database.using submit button i am getting result but i inserted one submit image and i gave link to that image and then i run that script but its not working now.Can u tell me using link how to retrive the datas. here i pasted my script ---------------------search.php-------------- <form name="form1" method="get"> <table width="200" border="1">
3
2633
kaleeswaran
by: kaleeswaran | last post by:
ResultSet rs=st.executeQuery("select i_sign from t_customer_photo where n_customer_id=1"); while(rs.next()) { byte bytearray = new byte; int size=0; InputStream sImage; sImage = rs.getBinaryStream(1); response.reset(); ...
1
1110
by: prabhakarbtechit | last post by:
Hi, i am beginer in .net i have stored Free Text Box values i mean html content, while retriving that values i have to substring it, so after substring that values it comes with html tags in display i want to quit it, can any one help me Regards, G.prabhakaran
0
1096
by: pchaitanya | last post by:
hi all, suppose in a table if i have columns namely name,entrydate now on retriving and binding to a gridview how can I get names rowwise and entrydate columnwise on a gridview on Xaxis I want entrydate and yaxis names in following format -----------------------------------------------------------------------------------
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9496
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8989
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.