Hi
I am trying to get a date from a textfield in vb.net to sql server 2000. The data type is datetime. The problem is no matter what I enter or how I enter it, the entry goes in to the db as 1/1/1900. I've included pieces of relevant code. Please help. Thanks
If IsDate(textdate.Text) = FalseThen
MsgBox("please enter a valid date")
Else
Dim str AsString = "insert demographic(accnum, clinic, qdate) values (" & _
acc & "," & _
preparestr(textclinic.Text) & "," & _
textdate.Text & ")"
mycommand = New SqlCommand(str, myconnection)
mycommand.ExecuteNonQuery()
End If
I am trying to get a date from a textfield in vb.net to sql server 2000. The data type is datetime. The problem is no matter what I enter or how I enter it, the entry goes in to the db as 1/1/1900. I've included pieces of relevant code. Please help. Thanks
If IsDate(textdate.Text) = FalseThen
MsgBox("please enter a valid date")
Else
Dim str AsString = "insert demographic(accnum, clinic, qdate) values (" & _
acc & "," & _
preparestr(textclinic.Text) & "," & _
textdate.Text & ")"
mycommand = New SqlCommand(str, myconnection)
mycommand.ExecuteNonQuery()
End If