i have this:
[code=text]
Dim Date1 As String = Format$(Now)
[/code]
which gives the value like: "15/02/2008 13:29:41"
now im using this:
[code=text]
con.CommandText = "update users set [passwordchanged] = " & "'" & Date1 & "'" & " where [login] = " & "'" & txtlogchange.Te xt & "'"
[/code]
Date1 is being inserted into an sql table, field is smalldatetime(4 ).
I get the error:
The statement has been terminated.
The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.
So how do iformat my date so it matches the smalldatetime(4 ) data type in sql server?
All other values in the table look like:
"15/02/2008 13:29:41"
So whats the problem?
James
[code=text]
Dim Date1 As String = Format$(Now)
[/code]
which gives the value like: "15/02/2008 13:29:41"
now im using this:
[code=text]
con.CommandText = "update users set [passwordchanged] = " & "'" & Date1 & "'" & " where [login] = " & "'" & txtlogchange.Te xt & "'"
[/code]
Date1 is being inserted into an sql table, field is smalldatetime(4 ).
I get the error:
The statement has been terminated.
The conversion of char data type to smalldatetime data type resulted in an out-of-range smalldatetime value.
So how do iformat my date so it matches the smalldatetime(4 ) data type in sql server?
All other values in the table look like:
"15/02/2008 13:29:41"
So whats the problem?
James
Comment