I'm having a really hard time trying to update my database with a date/time stamp.
Using a 'string' storage, I can store date/time but then I can't sort the date's because
it's in string format rather than datetime format in the database.
Right now I'm using NaviCat to manage the database.
The database is for the date field called 'LeafDayTime' is set to store a 'datetime' value.
In visual basic.net, I created an asmx project that accesses the database.
The Dataset's name is 'InfoSet' in which one of the values in the schema is called 'LeafDayTime'.
This also is a 'DateTime' value.
The subroutine I created shows the following to update the database.
What happens is that the database stores the name correctly and the date as 0/0/0000.
I've tried storing as Now.ToOaDate as another site suggested. doesn't work.
Only way around this is changing everything to a string for the date storing,
but then I'm back to square one in which I cannot sort the database by datetime
Please any help on this would be appreciated!
Using a 'string' storage, I can store date/time but then I can't sort the date's because
it's in string format rather than datetime format in the database.
Right now I'm using NaviCat to manage the database.
The database is for the date field called 'LeafDayTime' is set to store a 'datetime' value.
In visual basic.net, I created an asmx project that accesses the database.
The Dataset's name is 'InfoSet' in which one of the values in the schema is called 'LeafDayTime'.
This also is a 'DateTime' value.
The subroutine I created shows the following to update the database.
Visual Basic:
Private Function LeafofTheDay_Set(ByVal name As String) As String
InfoSystem.InsertCommand.CommandText = "UPDATE Info SET LeafoftheDay = '" & name & "', LeafDayTime = '" & Now & "' "
' Update Info
InfoSystem.InsertCommand.Connection.Open()
InfoSystem.InsertCommand.ExecuteNonQuery()
InfoSystem.InsertCommand.Connection.Close()
End Function
What happens is that the database stores the name correctly and the date as 0/0/0000.
I've tried storing as Now.ToOaDate as another site suggested. doesn't work.
Only way around this is changing everything to a string for the date storing,
but then I'm back to square one in which I cannot sort the database by datetime
Please any help on this would be appreciated!