You will get this error because of the datetime Format. You can try like this:-
<asp:TextBox ID="txtdate" runat="server"> </asp:TextBox>
<cc1:CalendarEx tender ID="CalendarDat eFrom" runat="server" TargetControlID ="txtdate"
Format="dd/MM/y yyy">
</cc1:CalendarE xtender>
<cc1:CalendarEx
Format="dd/MM/y
</cc1:CalendarE
//************ To Change the Date
format from dd/MM/yyyy to MM/dd/yyyy************//
string Date_Of_Punch = txtdate.Text;
System.Globalization.DateTimeFormatInfo
datePunch = new System.Globalization.DateTimeFormatInfo();
datePunch.ShortDatePattern = "dd/MM/yyyy";
DateTime Punch = Convert.ToDateTime(Date_Of_Punch,
datePunch);
//*******pass your date below for
inserting
Attendance.Punch_Date = Punch;
//************ To Change the Date
format from dd/MM/yyyy to MM/dd/yyyy************//
No comments:
Post a Comment
Please don't spam, spam comments is not allowed here.