when you want to update a datetime column in DB you should use DateTime structure,there is a table mapping,
nvarchar(sql)---------->System.string(.NET)
datetime(sql)---------->System.DateTime(.NET)
Money(sql)---------->System.Decimal(.NET)
so you should convert your string in the TextBox to DateTime by Parse method,something like below
Code:
//check for syntax..
DateTime dt=DateTime.Parse(TextBox1.Text);
SqlConnection objConnection=new SqlConnection(strConnection);
string upd="Update Employees SET BirthDate=@BirthDate";
upd+=" WHERE EmployeeID=@EmployeeID";
SqlCommand updCommand=new SqlCommand(upd,objConnection);
updCommand.Parameters.Add("@BirthDate",SqlDbType.DateTime);
updCommand.Parameters["@BirthDate"].Value=dt;
updCommand.Parameters.Add("@EmployeeID",SqlDbType.Int);
updCommand.Parameters["@EmployeeID"].Value=1;
objConnection.Open();
updCommand.ExecuteNonQuery();
objConnection.Close();
_____________
Mehdi.
software student.