starship_wars
asked on
Web application SQL shows several AWAITING COMMAND
I've got this ASP1.1 web application that displays data from SQL Server 2000. When the page loads, I use sp_who to see the spid and userid of my app, status is 'sleeping' and cmd is 'AWAITING COMMAND'. On some postbacks, a new row is added to the sp_who with new spid, same userid of my app with same status and cmd.
What could be causing this? How can I reduce these?
I am thinking it is database connections. In the code, a conn object is created, during various method it is opened, sometimes SqlDataReaders are used with .ExecuteReader, reader is closed and conn is closed in each method's Finally clause.
Try
command = New SqlCommand(strCommand, conn1)
myReader = command.ExecuteReader(Syst em.Data.Co mmandBehav ior.Defaul t)
destField.Items.Add(New ListItem("", 0))
While (myReader.Read())
destField.Items.Add(New ListItem(CStr(Trim(myReade r("Product _Name"))), CInt(myReader("Product_ID" ))))
End While
Finally
myReader.Close()
What could be causing this? How can I reduce these?
I am thinking it is database connections. In the code, a conn object is created, during various method it is opened, sometimes SqlDataReaders are used with .ExecuteReader, reader is closed and conn is closed in each method's Finally clause.
Try
command = New SqlCommand(strCommand, conn1)
myReader = command.ExecuteReader(Syst
destField.Items.Add(New ListItem("", 0))
While (myReader.Read())
destField.Items.Add(New ListItem(CStr(Trim(myReade
End While
Finally
myReader.Close()
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.