Hi Mario:
It's pretty easy, comments inline:

Signature
W.G. Ryan MVP Windows - Embedded
http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
> Greetings,
>
[quoted text clipped - 20 lines]
>
> 1. Any ideas on solving this issue?
You can trap the Connection's InfoMessage event.
http://www.knowdotnet.com/articles/connections.html Even though this is
supposed to trap errors with a severity level < 10 and print messages aren't
errors inthe traditional sense, they'll come back with infomessage.
> 2. How about capturing the rows from multiple SELECT statements
> executed within a stored proc?
If your DB supports batch queries, which it does if you are using SqlServer,
then you the subsequent queries will be in additinoal tables. If you do a
DataSet.Tables.Count you should see that. (So, if you have a batch query,
just call Adapter.Fill(dataset) and then check your table count.
> 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?
Although you may want to use a Thread as well to help make a more responsive
ui (data access apps lend themeselves nicely to multithreading), you can
call SqlCommand's .Cancel method. You'll note that the documentation says
it 'attempts to cancel a the execution..."
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fsystemdatasqlclientsqlcommandclasstopic.asp
I recommend reading the Remarks section b/c this isn't a guaranteed process
and it often behaves in ways you may not want - but so does cancelling a
command in QA.
If you have any additional questions, please don't hesitate to let me know.
HTH,
Bill
> Thanks!
> Mario T. Lanza
> Clarity Information Architecture, Inc.
Mario T. Lanza - 24 May 2004 21:36 GMT
Bill,
Your suggestions worked fine, thanks. Now I call all my SQL COMMANDS
using the SqlDataAdapter.Fill(DataSet) method. Plus I am subscribed
to the SqlConnection.InfoMessage event. Trouble is I want to capture
the "rows affected" values that usually appear in the SQL Server Query
Analyzer. I can get this value when I execute my sql statements via a
SqlCommand.ExecuteNonQuery method, but not with the DataAdapter.
Any ideas?
Mario
William Ryan eMVP - 25 May 2004 03:55 GMT
Fill and Update return integers and will show the records affected although
with fill it may not be what you want b/c it's the nubmer that were changed
if I remember correctly. After fill, you can interrogate
DataTableName.Rows.Count to get the record count. Glad the infomessage
worked for you.
You may also want to read my article(s) on datatable .compute which is
another good way to grab aggregate information like count, sum, avg etc,
especially if you need to filter it on anything.
http://www.knowdotnet.com/articles/expressions.html

Signature
W.G. Ryan MVP Windows - Embedded
http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
> Bill,
>
[quoted text clipped - 7 lines]
> Any ideas?
> Mario
Mario T. Lanza - 25 May 2004 18:34 GMT
I apologize for keeping this going when I should have gotten it by
now. Here's the jist the best way I can explain it.
======================================
CREATE PROCEDURE DoTest AS
print 'customers...'
select top 10 * from Customer
print 'customer orders...'
select top 10 * from [CustomerOrder]
print 'updating customer...'
update Customer
set GivenName = 'John'
where Surname = 'Smith' and GivenName = 'Jon'
======================================
If I call this procedure in SQL Query Analyzer I get...
======================================
customers...
(10 row(s) affected)
checks...
(10 row(s) affected)
updating customer...
(1 row(s) affected)
======================================
In addition the grids panel populates two grids with 10 rows each.
I want to mimic these messages exactly. Granted, it's not super
important; my app will work just fine without precise messages;
however, it's more of a thorn in my brain asking, "Why does something
so seemingly easy seem so hard to accomplish?"
Anyway, you've been very helpful. If there's no easy way, thanks for
your help thus far!
Mario
William Ryan eMVP - 28 May 2004 21:47 GMT
Hi Mario:
I just saw your post. I'm going to have to take another look at it to get it
to output exactly but it shoudl be doable.
hth,
Bill

Signature
W.G. Ryan, eMVP
http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
http://www.devbuzz.com/content/zinc_personal_media_center_pg1.asp
> I apologize for keeping this going when I should have gotten it by
> now. Here's the jist the best way I can explain it.
[quoted text clipped - 39 lines]
> your help thus far!
> Mario
Did anybody get an answer or a solution to this problem?
Mary Chipman - 21 Jun 2004 15:23 GMT
What problem?
--Mary
>Did anybody get an answer or a solution to this problem?
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
>----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
>----------------------------------------------------------