GridViewRow row = GridView1.Rows[e.RowIndex]; string eno; eno = GridView1.DataKeys[e.RowIndex].Value.ToString(); TextBox empname = (TextBox)row.FindControl("txtempname"); DropDownList status = (DropDownList)row.FindControl("DropDownList1"); string selval; if (status.SelectedValue == "Yes") { selval = "Y"; } else { selval = "N"; } sqlcon.Open(); sqlcmd = new SqlCommand("update emp set empname='" + empname.Text + "',empstatus='" + selval + "' where eno='" + eno + "'",sqlcon); sqlcmd.CommandType = CommandType.Text; sqlcmd.ExecuteNonQuery(); sqlcon.Close(); GridView1.EditIndex = -1; GridData();
string selectedValue = ddlCategory.SelectedValue;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)