date fiels insertation problem
hi...
my form has a text box which displays system date.
i am inserting date into MS SQL Server from this date textbox.
but it displays me error..
String was not recognized as a valid DateTime.
Line 154: myCommand1.ExecuteNonQuery()
i have written code as
myCommand1.Parameters.Add(New SqlParameter("@date", SqlDbType.DateTime, 8))
myCommand1.Parameters("@date").Value = FormatDateTime(datetxt.Text, DateFormat.GeneralDate)
and also tried to change date format with many other ways.
how should i solve this problem?
i also want to take time form a user with the help of web form and want to store it in other field called 'timein' and 'timeout'.....
|