Errors Errors DB Errors
Ok, this has to be simple I have a connection to a db I am trying to reterive and set lbl1.text to the count of the rs record count. but keep getting the error
System.InvalidCastException: Cast from type 'Field' to type 'String' is not valid
here is my code.
Public Sub New()
Dim connstring As String
Dim sqlStmt As String
Dim rst As Object
Dim strRowCnt As String
connstring = ConfigurationSettings.AppSettings("ConnectionStrin g")
sqlStmt = "Select Count(*)as rCount from secure"
rst = CreateObject("ADODB.Recordset")
rst.open(sqlStmt, connstring)
lbl1.Text() = rst("rcount")
End Sub
|