Transaction across 2 DB''s

  • Could be of a connection setting implicit transaction on/off. Sure that any begin transaction has a matching rollback or commit transaction statement?

    Have you checked your stored procedure with microsoft best practices analyzer for sql server (http://www.microsoft.com/downloads/details.aspx?FamilyID=B352EB1F-D3CA-44EE-893E-9E07339C1F22&displaylang=en)?

  • Its not your SQL.

    You should have them add this to the .NET app. Since there are several methods in ADO.NET to open a database connection (sqlCommand, DataReader, DataAdapter), the connection state may need to be cleaned up after or before.  Usually SqlCommand and DataAdapter connections are opened and closed by the ADO.NET, but the DataReader needs to be opened and closed as well as the database connection.

    'add this bloc

    If conn.ConnectionState = Connection.Open Then

        conn.close()

    End IF

    'end of bloc, and should immediately precede this statement

    conn.open()

    reader.open()

    while reader.read()

    'read one line at a time

    End while

    reader.close()

    conn.close()

     

Viewing 2 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply