I am having a problem with my web application in ASP.NET.
My error is:
The connection was not closed the connection's current state is open
when both clients submit a request in the connection string.
This is my code:
Public Sub populateGrid(ByVal sql As String, ByVal grd As GridView)
Try
cmd = New SqlCommand(sql)
da = New SqlDataAdapter(sql, conn)
conn.Open()
ds = New DataSet
da.Fill(ds)
grd.DataSource = ds
grd.DataBind()
conn.Close()
Catch ex As Exception
Throw ex
Finally
conn.Close()
End Try
End Sub
How can I hand multiple requests that my connection string can handle?
Please help!
Thank you!