convert string to date

  • Thread starter Thread starter Elliot
  • Start date Start date
E

Elliot

How can to save a string("13/12/2007") in a field which datatype is date in
the table?

field["dob"] = xxx?
 
How can to save a string("13/12/2007") in a field which datatype is date
in the table?

field["dob"] = xxx?

field["dob"] = Convert.ToDateTime("13/12/2007");
field["dob"] = DateTime.Parse("13/12/2007");
field["dob"] = ParseExact("13/12/2007", "dd/MM/yyyy", null);
 
field["dob"] = ParseExact("13/12/2007", "dd/MM/yyyy", null);

Apologies - slip of the Enter key...

field["dob"] = DateTime.ParseExact("13/12/2007", "dd/MM/yyyy", null);
 
Back
Top