thanx for any helpIt's likely because the DateTime class can't figure out what date format the string is in. If you use DateTime.Parse that might work or if you always know what format your string is in use DateTime.ParseExact, because with that you can specify the date format.
Try:
FromDate = Convert.ToDateTime(Request.Form["FromDate"].ToString()).Date;
Where FromDate is the txtField - I had trouble with this - Seems like going around the houses a bit to me, but it works.
Pete
0 comments:
Post a Comment