I have a large application that is distributed over many workstations and at another site ... Sometimes a development computer is not available (especially working offsite) and we need a way of running queries against the database
Due to this, i am writing a quick 'Query Analyzer' clone into my program, available only to developers and people with the right access levels
Anyways, I've done this before where i basically return the results of a DataAdapter.fill into a Dataset and populate a grid with it.
However, as an added extra i also want to retrieve the 'info' messages of an update/insert/delete back to the application pretty much exactly how Query analyzer does in it's messages tab.
I.e. If i run the following code:
.CommandText = "UPDATE PRODUCT SET ABC = 1 WHERE PRODUCT_ID = 123 GO SELECT * FROM PRODUCT WHERE PRODUCT_ID = 123"
.CommandType = CommandType.Text
.Connection = m_oQuery_Conn
.CommandTimeout = 180
Dim adapter As New SqlClient.SqlDataAdapter(cm)
Dim ds As New DataSet
Me.Grid_Query.DataSource = ds
This will perform the update on product '123' and also show me the results, however, when you do this in Query analyzer you also get the output:
(1 row(s) updated)
Is there any way to get these messages??
I've tried handling the connection's infomessage event, but it will only result errors and prints from what i can see.