I am retrieving date and passing to the function :
Bind(GetDate(Convert.ToString(Session["TransDate"])),
GetDate((Convert.ToDateTime(Session["TransDate"]).AddDays(1)).ToString("MM-dd-yyyy")));
The get date function is described below :
private String GetDate(String strDate)
{
String strDate1 = String.Empty;
if (strDate != "")
{
String[] arrDate = strDate.Split('/');
if (arrDate.Length == 1)
{
arrDate = strDate.Split('-');
}
strDate1 = arrDate[1] + "/" + arrDate[0] + "/" + arrDate[2];
}
return strDate1;
}
it gives me error as :
"string was not recognized as a valid date time".