A SQL Server 2005 DB table has 4 columns namely "ID" (IDENTITY int
column), "FirstName" (varchar(50)), "LastName" (varchar(50)) & "DOB"
(datetime). Now when I am trying to add a new row using the following
INSERT statement:
sqlDapter.Inser tCommand = New SqlCommand
sqlDapter.Inser tCommand.Comman dText = "INSERT INTO UserDetailss
VALUES('bobby', 'simpson','" & Now() & "')"
sqlDapter.Inser tCommand.Connec tion = sqlConn
sqlDapter.Updat e(dSet, "UserDetail s")
'Response.Write ("INSERT INTO UserDetailss VALUES('bobby', 'simpson','" &
Now() & "')"
the following error gets generated pointing to the Update line:
The conversion of a char data type to a datetime data type resulted in
an out-of-range datetime value.
I even tried using the different DateTime Format functions but none of
them work. WHere am I going wrong?
Thanks
Arpan
column), "FirstName" (varchar(50)), "LastName" (varchar(50)) & "DOB"
(datetime). Now when I am trying to add a new row using the following
INSERT statement:
sqlDapter.Inser tCommand = New SqlCommand
sqlDapter.Inser tCommand.Comman dText = "INSERT INTO UserDetailss
VALUES('bobby', 'simpson','" & Now() & "')"
sqlDapter.Inser tCommand.Connec tion = sqlConn
sqlDapter.Updat e(dSet, "UserDetail s")
'Response.Write ("INSERT INTO UserDetailss VALUES('bobby', 'simpson','" &
Now() & "')"
the following error gets generated pointing to the Update line:
The conversion of a char data type to a datetime data type resulted in
an out-of-range datetime value.
I even tried using the different DateTime Format functions but none of
them work. WHere am I going wrong?
Thanks
Arpan
Comment