When i selecting row from gridview for editng and does not has date in date column then this exception is raising
String was not recognized as a valid DateTime.'
- protected void Edit(object sender, EventArgs e)
- {
- using (GridViewRow row = (GridViewRow)((LinkButton)sender).Parent.Parent)
- {
- txtEmpID.ReadOnly = true;
- txtEmpID.Text = row.Cells[0].Text;
- txtEmpName.Text = row.Cells[1].Text;
- txtFahterName.Text = row.Cells[2].Text;
-
-
-
-
- ddlSecID.ClearSelection();
- if (ddlSecID.Items.FindByText(row.Cells[3].Text) != null)
- {
- ddlSecID.Items.FindByText(row.Cells[3].Text).Selected = true;
- }
- txtjdate.Text = Convert.ToDateTime(row.Cells[4].Text).ToString("dd/MM/yyyy");
-
- txtldate.Text = Convert.ToDateTime(row.Cells[5].Text).ToString("dd/MM/yyyy");
-
- popup.Show();
- }