G
Guest
I'm trying to put together a web form that lists all current session information. The session info is stored in SQL server database (ASPState) and I'm trying to retreive and display using a SQLDataReader. I seem to have no trouble querying the "ASPStateTempSessions" table but when I try to write it to the page, I throw an exception that basically says that there is no data to display. Is there some special method you must use when performing this sort of task?
The code is as follows:
------------------------------------------------------------
dim cn as new SqlConnection(ConfigurationSettings.AppSetting ("ASPState").toString())
cn.Open()
dim cmd as new SqlCommand("select * from ASPStateTempSessions where TimeOut = 40", cn)
dim dr as SqlDataReader
dr = cmd.ExecuteReader()
Response.Write(dr("Locked"))
The code is as follows:
------------------------------------------------------------
dim cn as new SqlConnection(ConfigurationSettings.AppSetting ("ASPState").toString())
cn.Open()
dim cmd as new SqlCommand("select * from ASPStateTempSessions where TimeOut = 40", cn)
dim dr as SqlDataReader
dr = cmd.ExecuteReader()
Response.Write(dr("Locked"))