hi am getting this error,what is the meaning of this error.how should i detect this error?
am getting the error like this
C# code is....
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Image img = (Image)e.Row.FindControl("resultImage");
Double SelectedOption =Double.Parse(e.Row.Cells[2].Text); //First cell - change accordingly
Double CorrectOption = Double.Parse(e.Row.Cells[3].Text); //Second cell - change accordingly
if (SelectedOption == CorrectOption) img.ImageUrl = "~/D:/pratyusha/project/newonlineexam/newonlineexam/Pictures/correct.jpg";
else if (SelectedOption != CorrectOption) img.ImageUrl = "~/D:/pratyusha/project/newonlineexam/newonlineexam/Pictures/wrong.jpg";
}
}
Server Error in '/' Application.
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Input string was not in a correct format.
Source Error:
Line 29: {
Line 30:
Line 31: if (e.Row.RowType == DataControlRowType.DataRow) Line 32: {
Line 33: Image img = (Image)e.Row.FindControl("resultImage");
Source File: D:\pratyusha\project\newonlineexam\newonlineexam\DotNetResultAdmin.aspx.cs Line: 31
Stack Trace:
[FormatException: Input string was not in a correct format.] System.Number.ParseDouble(String value, NumberStyles options, NumberFormatInfo numfmt
manimala