Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
protected void RowUpdating(object sender, GridViewUpdateEventArgs e)
{
GridViewRow row = Gridview1.Rows[e.RowIndex];
string pan = (row.FindControl("txtPan") as TextBox).Text;
string Depository = (row.FindControl("txtDepository") as TextBox).Text;
string Mobile = (row.FindControl("txtMobile") as TextBox).Text;
string Email = (row.FindControl("txtEmail") as TextBox).Text;
string DPID = (row.FindControl("txtDPID") as TextBox).Text;
string Client_Bef_Id = (row.FindControl("txtClient_Bef_Id") as TextBox).Text;
string UPI_ID = Convert.ToString((row.FindControl("txtUPI_ID") as TextBox).Text);
DataTable dt = ViewState["dt"] as DataTable;
dt.Rows[e.RowIndex]["Pan"] = pan;
dt.Rows[e.RowIndex]["Depository"] = Depository;
dt.Rows[e.RowIndex]["Mobile"] = Mobile;
dt.Rows[e.RowIndex]["Email"] = Email;
dt.Rows[e.RowIndex]["DPID"] = DPID;
dt.Rows[e.RowIndex]["Client Bef Id"] = Client_Bef_Id;
dt.Rows[e.RowIndex]["UPI ID"] = UPI_ID;
ViewState["dt"] = dt;
Gridview1.EditIndex = -1;
BindGrid();
}

What I have tried:

Input string was not in a correct format.Couldn't store <1561513g> in Pan Column. Expected type is Double.
Posted
Updated 20-Oct-21 1:37am
Comments
Richard MacCutchan 20-Oct-21 7:35am    
That string is not a valid double.

1 solution

The error is pretty clear, isn't it? You tried to put 1561513g into a field that only accepts numbers. You need to check your data and make sure it should be a double or maybe you need to change the column to accept all characters.
 
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