Hi i keep getting an exception when i'm trying to update table values within a database. the exception is below but i dont change from datetime to varchar it always stay as datetime.
is there any other reasons why this is happening ?
"The conversion of a varchar data type to a datetime data type resulted in an out-of-range value."
objtyp.dtForm = Convert.ToDateTime(reader["dtFrom"]);
public DateTime dtForm
{
get;
set;
}
string SQL = "UPDATE TABLE_NAME SET dtFrom = '" + objtyp.dtForm + "' WHERE ObjectTypeID = 1";
Thanks
Chris