Re: ADO.NET - Exception "Operation cancelled by user" -
From: dubian (collatz_at_bigtexansoftware.com)
Date: 02/14/05
- Next message: Sahil Malik: "Re: Using Interfaces"
- Previous message: Patrick: "Re: sp does not return right value but query analyzer does"
- In reply to: William \(Bill\) Vaughn: "Re: ADO.NET - Exception "Operation cancelled by user" -"
- Next in thread: William \(Bill\) Vaughn: "Re: ADO.NET - Exception "Operation cancelled by user" -"
- Reply: William \(Bill\) Vaughn: "Re: ADO.NET - Exception "Operation cancelled by user" -"
- Messages sorted by: [ date ] [ thread ]
Date: 14 Feb 2005 07:07:27 -0800
I apologize, I was feeling rushed when I initially posted and obviously
did a poor job with the details.
I created a C# com control to use ADO.NET 1.1 with the SqlClient as the
DB connectivity tool.
When I call 'command.Cancel()', on occasion I get the above
exception and the connection closes. I get an 'attention' when I
monitor with the SQL profile but cannot find the cause or details of
the attention entry.
If I remove the call to cancel, (which is being called before every new
querry), the exception is never seen.
Code sample.
EstablishNewConnection and command associated with connection.
For each new command against server:
Command.Cancel()
anyOpenReaderOnConnection.Close()
Command.CommandText = "sql command"
Command.CommandTimeout() = value
Command.ExecuteReader()
Work with Reader.....
It is when ExecuteReader is called, that the exception is thrown on
occasion. I feel there is some 'racecondition' somewhere getting
mangled by repeatedly calling cancel and that sometimes the cancel is
actually forwarded to the server after ExecuteReader is called. Or
something like that.
Thanks.
- Next message: Sahil Malik: "Re: Using Interfaces"
- Previous message: Patrick: "Re: sp does not return right value but query analyzer does"
- In reply to: William \(Bill\) Vaughn: "Re: ADO.NET - Exception "Operation cancelled by user" -"
- Next in thread: William \(Bill\) Vaughn: "Re: ADO.NET - Exception "Operation cancelled by user" -"
- Reply: William \(Bill\) Vaughn: "Re: ADO.NET - Exception "Operation cancelled by user" -"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|