Re: Exception: The SqlTransaction has completed; it is no longer usabl



Probably your SqlCommand.Transaction property has not been set to the return
value of SqlCommand.BeginTransaction.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
----------------------------------------------------------------------------




"HardKhor" <HardKhor@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:41BD2210-9A54-461F-8C4D-0433362754C5@xxxxxxxxxxxxxxxx
> Hi all,
>
> I hv encountered this exception 'The SqlTransaction has completed; it is
> no
> longer usable.' in my VB application. The application calls a T-SQL stored
> procedure, returning around 9000 rows in a DataSet and back to the app. It
> is
> built using VB .Net 2003, with SQL Server 2003 as the database.
>
> When that exception is thrown, I tried running the same stored procedure
> in
> Query Analyzer and it returns results within 4 seconds. And the weird
> thing
> is, after that error occured, even if I don't do anything to the system,
> after a few minutes it mysteriously goes away. And the VB app can return
> data
> within a few seconds! It is happening every now and then, and can occur
> even
> if only one or two users using the system.
>
> I was thinking if Query Analyzer can return data very quickly... Then cld
> it
> be something to do with the ADO.
>
> Hope someone can help me with this mysterious happening. TQ very much in
> advance.


.



Relevant Pages

  • Re: SQL Errors in Stored Procedures
    ... No duplicate row error this way (unless two sessions happen to have hit the ... executes a stored procedure to insert some records. ... VB.NET app as an exception. ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL Errors in Stored Procedures
    ... T-SQL / SQL Server currently have no way of doing this. ... the app & SQL Server to provide such functionality. ... executes a stored procedure to insert some records. ... VB.NET app as an exception. ...
    (microsoft.public.sqlserver.programming)
  • ADO vs Query Analyzer Performance -- Its not parameter sniffing
    ... Immediately calling the same stored procedure WITH SAME PARAMETERS from ... Query Analyzer returns the results almost immediately. ... Analyzer call returned very quickly (40 seconds from app, ... ADO/SQLOLEDB interaction with SQL Server is different than Query Analyzer. ...
    (microsoft.public.data.ado)
  • SQLOLEDB vs Query Analyzer performance (not parameter sniffing)
    ... Immediately calling the same stored procedure WITH SAME PARAMETERS from ... Query Analyzer returns the results almost immediately. ... Analyzer call returned very quickly (40 seconds from app, ... ADO/SQLOLEDB interaction with SQL Server is different than Query Analyzer. ...
    (microsoft.public.data.oledb)
  • Re: Exception: The SqlTransaction has completed; it is no longer usabl
    ... That exception will typically occur if you try to commit or rollback a ... > I hv encountered this exception 'The SqlTransaction has completed; ... returning around 9000 rows in a DataSet and back to the app. ... > I was thinking if Query Analyzer can return data very quickly... ...
    (microsoft.public.dotnet.framework.adonet)