Hi Everyone,
I am using Visual Studio to develop a web page which has to interact with an SQL server database. The problem I am running into is that when I am trying to UPDATE (or INSERT) a date, it is showing up in the database as "1/1/1900" when i enter a date in this field manually on the server, it wants it of the form "mm/dd/yyyy". When I step through my code, the variable I am inserting shows as '#4/19/2007#' - same form as required on maual entry.
I am wondering if anyone knows why this may be happening, or where I should look for a resolution.
Information:
SQL Fields are of type: smalldatetime
VB Code executing UPDATE Method:
Mike
______________________________________________________________
"It Seems All My Problems Exist Between Keyboard and Chair"
I am using Visual Studio to develop a web page which has to interact with an SQL server database. The problem I am running into is that when I am trying to UPDATE (or INSERT) a date, it is showing up in the database as "1/1/1900" when i enter a date in this field manually on the server, it wants it of the form "mm/dd/yyyy". When I step through my code, the variable I am inserting shows as '#4/19/2007#' - same form as required on maual entry.
I am wondering if anyone knows why this may be happening, or where I should look for a resolution.
Information:
SQL Fields are of type: smalldatetime
VB Code executing UPDATE Method:
Code:
[blue]Dim[/blue] TransDate [blue]As Date[/blue] = Today()
[blue]Dim[/blue] SQL [blue]As String[/blue]
SQL = [maroon]"UPDATE dbo_Resource SET DateSignedOut ="[/maroon] & TransDate & [maroon]" WHERE ResourceID ="[/maroon] & primaryKey
SqlDataSource1.UpdateCommand = SQL
SqlDataSource1.Update()
Mike
______________________________________________________________
![[banghead] [banghead] [banghead]](/data/assets/smilies/banghead.gif)