Hello,
I don’t understand the problem.
It works with DateTime.Now
I can’t find out.
Try
rowsFound = app.db.SelectSQL("select * from Dokumente where Datum > '01.01.2010' order by Datum asc")
For Each row as DatabaseRow in rowsFound
If rowsFound <> Nil Then
If row.Column("Datum").Value <> Nil Then
MessageBox(row.Column("Datum")) // shows first date from Dokumente correctly
var dat As Date = Row.Column("Datum").DateValue // No Errors in Code but crashes with dat = NIL // 'DateTime.Now' works!
Label_date.Text = dat.SQLDate // Convert to yyyy-mm-dd and set to 'Label_date.Text'
ListBox1.AddRow(row.Column( "Bezeichnung").StringValue, Label_date.text, row.Column( "Name").StringValue, row.Column( "Betrag").StringValue, row.Column( "ID").StringValue) // OK
Else
ListBox1.AddRow ""
End If
End if
Next
Catch error as DatabaseException
MessageBox("Error")
End Try
7 posts - 4 participants