How can I check if I have a connection open (to my DB)?<BR><BR>In classic ASP, I used this<BR><BR>If objRS.State <> "0" Then objRS.Close<BR><BR><BR>What can I use in ASP.NET?<BR>This doesn't work;<BR><BR>Dim objDataReader as OleDbDataReader<BR><BR>'now this doesnt work<BR>If objDataReader.State <> "0" Then objDataReader.Close()<BR><BR><BR>Anyone has an idea?<BR><BR>ThanksThe connection class has a State property that returns a ConnectionState enumeration. So, you could do:<BR><BR>If objConnection.State <> ConnectionState.Open then<BR> ...<BR>End If<BR><BR>See:<BR>ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemdataoledboledbconnectionclassstatetopic .htm<BR><BR>and :<BR>ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfsystemdataconnectionstateclasstopic.htm<BR><BR>hthI'll try it. Thanks