SqlCommand cmd = new SqlCommand();
cmd.CommandText = "UPDATE M_T1 SET c_name=@c_name WHERE rowid=@rowid";
cmd.Parameters.Add("@rowid", SqlDbType.Int).Value = Convert.ToInt32(grdmsal.Rows[e.RowIndex].Cells[1].Text);
cmd.Parameters.Add("@c_name", SqlDbType.VarChar).Value = ((TextBox) grdmsal.Rows[e.RowIndex].Cells[2].Controls[0]).Text;
<asp:GridView ID="Gridview1" runat="server" AutoGenerateColumns="False" CellPadding="4"
DataKeyNames="ROWID" ForeColor="#333333" GridLines="None" OnRowCancelingEdit="Gridview1_RowCancelingEdit"
OnRowDeleting="Gridview1_RowDeleting" OnRowEditing="Gridview1_RowEditing" OnRowUpdating="Gridview1_RowUpdating">
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<Columns>
<asp:CommandField HeaderText="Edit-Update" ShowEditButton="True" />
<asp:BoundField DataField="ROWID" HeaderText="Category ID" ReadOnly="True" />
<asp:BoundField DataField="c_name" HeaderText="Component Name" />
<asp:BoundField DataField="c_amt" HeaderText="Amount" />
<asp:BoundField DataField="c_type" HeaderText="Type" />
<asp:CommandField HeaderText="Delete" ShowDeleteButton="True" />
</Columns></asp:GridView>
i have the above but fater editing value when i update its not updated no error