A
amerrell
How can I prevent the flood of sleeping processes that occur from my database queries using datareaders?
Here is how I make my connections am I doing somehting wrong?
Dim myConnection As New SqlConnection(GetAppSetting("DBCon"))
Dim myCommand As New SqlCommand("Select * from table where column = @column", myConnection)
myCommand.Parameters.Add("@column", columnvalue)
Try
Dim dr As SqlDataReader
myConnection.Open()
dr = myCommand.ExecuteReader()
While dr.read()
strVar = dr("somecolumn")
end while
dr.close()
myconnection.close()
Catch ex as Exception
Trace.Write("SQLQuery ", ex.Message)
End Try
Thanks for any help...
amerrell
Here is how I make my connections am I doing somehting wrong?
Dim myConnection As New SqlConnection(GetAppSetting("DBCon"))
Dim myCommand As New SqlCommand("Select * from table where column = @column", myConnection)
myCommand.Parameters.Add("@column", columnvalue)
Try
Dim dr As SqlDataReader
myConnection.Open()
dr = myCommand.ExecuteReader()
While dr.read()
strVar = dr("somecolumn")
end while
dr.close()
myconnection.close()
Catch ex as Exception
Trace.Write("SQLQuery ", ex.Message)
End Try
Thanks for any help...
amerrell