Click here to Skip to main content
15,887,992 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
                DateTime conv = Convert.ToDateTime(e.Row.Cells[3].Text);

                string dat = conv.ToString("dd-MMM-yy");
                e.Row.Cells[3].Text = dat;
                e.Row.Cells[6].Text = dat;

            }
            if (grdv.Rows.Count > 0)
            {
                grdv.HeaderRow.Cells[0].Text = "Edit";
                grdv.HeaderRow.Cells[1].Text = "Attendance Detail Reference";
                grdv.HeaderRow.Cells[2].Text = "Course Detail Reference";
                grdv.HeaderRow.Cells[3].Text = "Date Of Attend";
                grdv.HeaderRow.Cells[4].Text = "Attendance ";
                grdv.HeaderRow.Cells[5].Text = "Reason ";
                grdv.HeaderRow.Cells[6].Text = "Last Updated Date";
                grdv.HeaderRow.Cells[7].Text = "Last Updated By";
                grdv.HeaderRow.Cells[8].Text = "Student id";
}
Posted
Comments
Thanks7872 5-Jun-14 6:51am    
I don't know as a developer why you are so lazy to use debugger,Google? If you just copy paste the error in Google, you will atleast find tons of link explaining the same issue.
[no name] 5-Jun-14 9:37am    
The question what you asked is already asked in CodeProject. Why didn't you use Google first?

1 solution

Read this awesome answer - String was not recognized as a valid DateTime.[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900