S
Scott M.
How do I convert a date (mm/dd/yy) entered into a textbox into a SQL Server
DateTime field?
I've tried this:
SqlTypes.SqlDateTime.op_Implicit(editText0.Text)
and this:
SqlTypes.SqlDateTime.op_Implicit(editText0.Text & " 12:00:00.000")
and this:
SqlTypes.SqlDateTime.op_Implicit(CType(editText0.Text, DateTime))
But, in each case, I get an error:
System.InvalidCastException: Specified cast is not valid. at
System.Convert.ToDateTime(Object value) at
System.Data.Common.DateTimeStorage.Set(Int32 record, Object value) at
System.Data.DataColumn.set_Item(Int32 record, Object value)Couldn't store
<9/10/2003 12:00:00 PM> in EventDate Column. Expected type is DateTime.
DateTime field?
I've tried this:
SqlTypes.SqlDateTime.op_Implicit(editText0.Text)
and this:
SqlTypes.SqlDateTime.op_Implicit(editText0.Text & " 12:00:00.000")
and this:
SqlTypes.SqlDateTime.op_Implicit(CType(editText0.Text, DateTime))
But, in each case, I get an error:
System.InvalidCastException: Specified cast is not valid. at
System.Convert.ToDateTime(Object value) at
System.Data.Common.DateTimeStorage.Set(Int32 record, Object value) at
System.Data.DataColumn.set_Item(Int32 record, Object value)Couldn't store
<9/10/2003 12:00:00 PM> in EventDate Column. Expected type is DateTime.