- protected void btnUpdate_Click1(object sender, EventArgs e)
- {
-
- TextBox txtGrade = (TextBox)grdLabEntry.Rows[0].FindControl("txtGrade");
- TextBox txtValidity = (TextBox)grdLabEntry.Rows[0].FindControl("txtValidity");
- TextBox txtFED = (TextBox)grdLabEntry.Rows[0].FindControl("txtFED");
-
-
-
- SpotEntry obj = new SpotEntry();
- obj.SpotEntryId = RId;
-
- obj.Grade = txtGrade.Text;
- obj.Validity = Convert.ToDateTime(txtValidity.Text);
- obj.FEd = Convert.ToDateTime(txtFED.Text);
-
- int result = SpotEntry.UpdateLabEntry(obj);
- if (result > 0)
- {
- grdLabEntry.EditIndex = -1;
-
- obj.SpotEntryId = RId;
- DataTable dt = SpotEntry.GetAllDmatRecordsById(obj);
- if (dt.Rows.Count > 0)
- {
- showmsg("Dmat Lab Entry Updated Successfully.");
- grdLabEntry.DataSource = dt;
- grdLabEntry.DataBind();
- }
- }
how to solve date string is not recognize as a valid date.
actully when insert date it take dd/mm/yyyy but when i select date greater then 12 it throw error date string not valid date because it understand dd /mm/yyyy to mm/dd/yyyy
so what can i do to solve this.
above is my code which i add in aspx file