this is my input to a text box from a datetime calendar
and to store the datetime in the DB i want the value to be changed to Date time.
DateTime Res_date = Convert.ToDateTime(txt_RespondBy.Text);
when I convert it gives a error saying string not recognised as valid date time. How to convert the input to date time..
value of txt_RespondBy.Text is : 10/27/2011 03:25
use DateTime.Parse, see MSDN: DateTime.Parse Method (String)
There is Also ParseExact where you can specify the pattern string you are using….