M
Mario T. Lanza
Greetings,
I am developing a SQL Server Query Analyzer replacement app to use in
the field to avoid having to purchase licensed copies for a vast
number of machines.
One of the things that Query Analyzer does is capture the output of
PRINT statements in the Messages area. I have been able to mimic this
by subscribing to the InfoMessages event of the SqlConnection object;
however, this only works when I call the SqlCommand.ExecuteNonQuery
method.
Sometimes the stored procs that I call from within my Query Analyzer
app return rows that I want to capture in a DataGrid. I was able to
do this using the SqlDataAdapter.Fill method to the table bound to the
grid.
The problem here is merging the two functions. I want to BOTH capture
result set rows AND the PRINT output text by making only one call to
the stored proc. I could call the proc twice, once using the
SqlDataAdapter.Fill method and once using the
SqlCommand.ExecuteNonQuery method, but this seems foolish.
1. Any ideas on solving this issue?
2. How about capturing the rows from multiple SELECT statements
executed within a stored proc?
3. Finally, it would be nice to be able to cancel a SqlCommand that is
actively running. I assume this is done with threads? Anybody have a
sample snippet of code?
Thanks!
Mario T. Lanza
Clarity Information Architecture, Inc.
I am developing a SQL Server Query Analyzer replacement app to use in
the field to avoid having to purchase licensed copies for a vast
number of machines.
One of the things that Query Analyzer does is capture the output of
PRINT statements in the Messages area. I have been able to mimic this
by subscribing to the InfoMessages event of the SqlConnection object;
however, this only works when I call the SqlCommand.ExecuteNonQuery
method.
Sometimes the stored procs that I call from within my Query Analyzer
app return rows that I want to capture in a DataGrid. I was able to
do this using the SqlDataAdapter.Fill method to the table bound to the
grid.
The problem here is merging the two functions. I want to BOTH capture
result set rows AND the PRINT output text by making only one call to
the stored proc. I could call the proc twice, once using the
SqlDataAdapter.Fill method and once using the
SqlCommand.ExecuteNonQuery method, but this seems foolish.
1. Any ideas on solving this issue?
2. How about capturing the rows from multiple SELECT statements
executed within a stored proc?
3. Finally, it would be nice to be able to cancel a SqlCommand that is
actively running. I assume this is done with threads? Anybody have a
sample snippet of code?
Thanks!
Mario T. Lanza
Clarity Information Architecture, Inc.