I am trying to find out the correct format for assigning a date value to one of my form elements.
I am getting the following error:
"String was not recognized as a valid DateTime"
with this code;
I tried to replace the code with this:
Then now, I am getting this error:
Prepared statement '(@txtrequest varchar(64),@txtassignedTo varchar(64),@description' expects parameter @txttargetDate, which was not supplied.
Does anyone have any idea how to fix this?
Thanks in advance
I am getting the following error:
"String was not recognized as a valid DateTime"
with this code;
Code:
objCommand.Parameters("@txttargetDate").Value = txttargetDate.Text
I tried to replace the code with this:
Code:
If Not (txttargetDate.Text Is Nothing) then
objCommand.Parameters("@txttargetDate").Value = CType( txttargetDate.Text , System.DateTime)
else
objCommand.Parameters("@txttargetDate").Value = Nothing
end if
Then now, I am getting this error:
Prepared statement '(@txtrequest varchar(64),@txtassignedTo varchar(64),@description' expects parameter @txttargetDate, which was not supplied.
Does anyone have any idea how to fix this?
Thanks in advance