{ string dpt = (string)Session["deptmnt"]; string con = ConfigurationManager.ConnectionStrings["con"].ConnectionString; SqlConnection con1 = new SqlConnection(con); con1.Open(); string qry = @"select * from faculty where ((fid like '%" + dpt + "%') and (fid='"+Label17.Text+"'))"; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = new SqlCommand(qry, con1); string upd = @"update faculty SET fname = '" + TextBox7.Text + "',gender='" + DropDownList10.SelectedValue + "', dept = '" + DropDownList5.SelectedValue + "', maxbooks = '" + DropDownList8.SelectedValue + "' WHERE fid = '" + Label17.Text + "'"; SqlCommandBuilder cb = new SqlCommandBuilder(da); DataSet ds = new DataSet(); da.Fill(ds, "faculty"); DataTable dt = ds.Tables["faculty"]; dt.Rows[1]["fname"] = TextBox7.Text; dt.Rows[1]["gender"] = DropDownList10.SelectedValue; dt.Rows[1]["dept"] = DropDownList5.SelectedValue; dt.Rows[1]["maxbooks"] = DropDownList8.SelectedValue; SqlCommand cmd = new SqlCommand(upd, con1); da.UpdateCommand = cmd; da.Update(ds, "faculty"); con1.Close(); }
dt.Rows[0]["fname"] = TextBox7.Text; dt.Rows[0]["gender"] = DropDownList10.SelectedValue; dt.Rows[0]["dept"] = DropDownList5.SelectedValue; dt.Rows[0]["maxbooks"] = DropDownList8.SelectedValue;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)