Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connection opened by object reference not found
Message
From
06/09/2010 14:51:18
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
Connection opened by object reference not found
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01480329
Message ID:
01480329
Views:
95
I have a weird situation here. My connection state is Open but once I assign the connection to oCommand.Connection, it says "Object reference not found".

Basically, the following logic assigns an already opened connection or opens it and assigns it after:
            ' If the connection is already opened
            If lConnectionIsAlreadyOpened Then
                    oCommand.Connection = oApp.aConnection(nConnectionString, 2)
            Else

                ' Open the connection
                loConnection = New OdbcConnection(oConnectionOpenManually.cConnectionString)

                ' Open the connection
                loConnection.Open()

                oCommand.Connection = loConnection
            End If
When I trace it, when the connection is not already opened, after loConnection.Open(), it says that the connection state is Open. However, it crashes on the next line saying the "Object reference not found". If it is already opened, what could cause it to generate this error?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform