Gridview

Bhargavsrinivaas
Posted by Bhargavsrinivaas under C# category on | Points: 40 | Views : 1117
try
{
int Id = int.Parse(gd.Rows[e.RowIndex].Cells[1].Text);
TextBox txt_sn = gd.Rows[e.RowIndex].Cells[2].Controls[0] as TextBox;
con.Open();
string query = string.Format("Update registration set Studentname where Studentid='{0}'", txt_sn.Text);


SqlCommand cmd = new SqlCommand();
cmd.CommandText = query;
cmd.Connection = con;

}
// string Studentname = ((TextBox)gd.Rows[e.RowIndex].FindControl("txt_sn1")).Text;
catch (Exception ee)
{
Response.Write(ee.Message);
}
finally
{
con.Close();
}
here is my code for gridview to update using boundfeild in asp.net and above related code in c# but im getting an error
Input string was not in a correct format. 1
Object reference not set to an instance of an object. 2

Comments or Responses

Posted by: Bhargavsrinivaas on: 2/4/2016 Level:Starter | Status: [Member] | Points: 10
gridview update code in c#

Login to post response