BlakeMcKenna
asked on
Error converting data type nvarchar to datetime?
I'm getting the error "Error converting data type nvarchar to datetime" on the following line:
In the Database table this column ("startTime") is defined as a DateTime data type. Is there a better way to code this line?
Thanks!
cmd.Parameters.AddWithValue("@startTime", row("startTime")).Value = If(row("startTime").ToString.Length = 0, DBNull.Value, row("startTime"))
In the Database table this column ("startTime") is defined as a DateTime data type. Is there a better way to code this line?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
James,
I tried your solution and that worked!
Thanks!
I tried your solution and that worked!
Thanks!
However, in your update or insert statement.. try the following...
StartTime=Convert(datetime