473,399 Members | 3,106 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,399 software developers and data experts.

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 7392
Hi,

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

Ken
-------------------------
"James Proctor" <Ja**********@discussions.microsoft.com> wrote in message
news:C6**********************************@microsof t.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.SqlClient.SqlInfoMessageEventArgs _
) Handles cn.InfoMessage
For Each err As System.Data.SqlClient.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**********@discussions.microsoft.com> wrote in message
news:C6**********************************@microsof t.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
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: ...
8
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,...
2
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...
1
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...
2
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,...
6
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...
3
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...
1
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...
0
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.