protected void gvDetails_RowUpdating(object sender, GridViewUpdateEventArgs e) { int userid = Convert.ToInt32(gvDetails.DataKeys[e.RowIndex].Value.ToString()); //ring user = gvDetails.DataKeys[e.RowIndex].Values["UserName"].ToString(); string username = gvDetails.DataKeys[e.RowIndex].Values["U_name"].ToString(); //string imagename = gvDetails.DataKeys[e.RowIndex].Values["ImageName"].ToString(); TextBox txtU_Email = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtU_Email"); TextBox txtImageName = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtImageName"); TextBox txtDescription = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtDescription"); TextBox txtCategoryName = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtCategoryName"); TextBox txtADshop_name = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtADshop_name"); TextBox txtADShop_Address = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtADShop_Address"); TextBox txtADshop_city = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtADshop_city"); TextBox txtADshop_mob = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtADshop_mob"); TextBox txtADshop_Email = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtADshop_Email"); TextBox txtAreaName = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtAreaName"); TextBox txtstartddate = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtstartddate"); TextBox txtendddate = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtendddate"); TextBox txtImagePath = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtImagePath"); TextBox txtdiffrence = (TextBox)gvDetails.Rows[e.RowIndex].FindControl("txtdiffrence"); con.Open(); OleDbCommand cmd = new OleDbCommand("UPDATE LOGIN u ,SlideShowTable s SET u.U_Email = '" + txtU_Email.Text + "',s.ImageName='" + txtImageName.Text + "',s.Description='" + txtDescription.Text + "',s.CategoryName='" + txtCategoryName.Text + "',s.ADshop_name='" + txtADshop_name.Text + "',s.ADShop_Address='" + txtADShop_Address.Text + "',s.ADshop_city='" + txtADshop_city.Text + "',s.ADshop_mob='" + txtADshop_mob.Text + "',s.ADshop_Email='" + txtADshop_Email.Text + "',s.AreaName='" + txtAreaName.Text + "',s.startddate='" + txtstartddate.Text + "',s.endddate='" + txtendddate.Text + "',s.ImagePath='" + txtImagePath.Text + "',s.diffrence='" + txtdiffrence.Text + "' where s.U_id=" + userid + " and u.U_id= " + userid, con); cmd.ExecuteNonQuery(); con.Close(); lblresult.ForeColor = Color.Green; lblresult.Text = username + " Details Updated successfully"; gvDetails.EditIndex = -1; BindEmployeeDetails(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)