SqlCommand cmd = new SqlCommand();
cmd.CommandText = "UPDATE M_t1 SET c_name=@c_name WHERE id=@id";
cmd.Parameters.Add("@id", SqlDbType.Int).Value = (Label)Convert.ToInt32(grdmsal.Rows.FindControl("Label1").Text);//
//(Label)grdmsal.Rows.FindControls("Label1").Text;
cmd.Parameters.Add("@c_name", SqlDbType.VarChar).Value = ((TextBox) grdmsal.Rows[e.RowIndex].Cells[2].Controls[0]).Text;
i am using above i have a id field based on which i update the records
i dont want to display the id field to user
the user just clicks edit against the row to be edited & shld be able toedit
above i get error nr find control
<Columns>
<asp:CommandField HeaderText="Edit-Update" ShowEditButton="True" />
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="Label1" Text='<%#Eval("ID")%>' runat="server"></asp:Label>
</ItemTemplate>
<asp:BoundField DataField="c_name" HeaderText="Name" /> </asp:TemplateField>
</Columns>