Yes. Another way to do Count would be to create a label and a Function and do this:
lblCount.Text = countDays()
Private Function countDays()
Dim strConn As String = ConfigurationSettings.AppSettings("dbLogs")
Dim objConn As New OleDbConnection(strConn)
Dim strSQL As String = "SELECT Count(thedate) FROM tableName"
Dim objCommand As New OleDbCommand(strSQL, objConn)
Dim sResult As String
objConn.Open()
sResult = CType(objCommand.ExecuteScalar(), String)
objConn.Close()
Return sResult
End Function
|