Connection still open after close()
Posted by: dohymion
Date: November 03, 2004 03:43AM

I have a problem with the MySqlConnection object, when i call the close() method the connection is still open. Is this a bug in the .NET Connector or an error in the code.

<WebMethod()> Public Function GetData() As DataSet
Dim data As DataSet = New DataSet
Dim ConMySql As New MySqlConnection(ConfigurationSettings.AppSettings.Item("ConStr"))
Dim sqlCmd As New MySqlCommand("SELECT * FROM tblArticles", ConMySql)
Dim MyDataAdapter As New MySqlDataAdapter(sqlCmd)

Try
ConMySql .Open()
MyDataAdapter.Fill(data)
ConMySql .Close()
If t.Tables(0).Rows.Count > 0 Then
Return data
Else
Return Nothing
End If
Catch Ex As System.Exception
Return Nothing
Finally
MyDataAdapter = Nothing
ConMySql = Nothing
End Try
End Function

Options: ReplyQuote


Subject
Written By
Posted
Connection still open after close()
November 03, 2004 03:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.