0
Answer

DateTime formatting

Jagannatha Thripp

Jagannatha Thripp

17y
1.8k
1
Hello Everyone, I am trying to pass two dates to a stored procedure in SQL server. I only require the date protion of the input not the time, but I cannot seem to get the formatting to just mm/dd/yyyy the data is collected from two text boxes on a web form and is imput as string in the format mm/dd/yyyy. The SP is expecting datetime parameters. I have tried so many variations to this I am wondering if it can even be done???? DateTime FromDate = DateTime.ParseExact(tempdt, "mm/dd/yyyy", System.Globalization.CultureInfo.InvariantCulture); DateTime Todate = Convert.ToDateTime(ToDateLbl.Text); None of these work. All help grealy accepted.