I'm using VB.NET and VS 2008, and having a problem selecting dates.
In the appointmentsmain table are 2 fields, StartDate and CustomerName
The StartDate contains dates formatted in this way ..
2013-01-29 11:16:41
Dim strSQL As String = "select * from AppointmentsMain"
Selecting all as above and reading via a DataReader throws the error. If I select the customername field only, it works fine.
I am using the System.Data.SQLite
wrapper.
Below is the code. It breaks on the msgbox. Try
Dim cn As SQLiteConnection
Dim cmd As SQLiteCommand
Dim rdr As SQLiteDataReader
Dim strSQL As String = "select * from AppointmentsMain"
cn = New SQLiteConnection(strPublicConnectionString)
cn.Open()
cmd = New SQLiteCommand(strSQL, cn)
rdr = cmd.ExecuteReader
If rdr.Read Then
MsgBox(rdr("startdate"))
End If
rdr.Close()
cn.Close()
Catch ex As Exception
End Try