<pre> protected void btnTenantSave_Click(object sender, EventArgs e) { if (!Page.IsPostBack) { //Creating a connection to my database using the connection string string cs = System.Configuration.ConfigurationManager.ConnectionStrings["rent-dbConnectionString1"].ConnectionString; SqlConnection con = new SqlConnection(cs); //preparing a query which will update the data in the database with the data entered into the textboxes SqlCommand cmd = new SqlCommand("UPDATE Tenants SET Tenant_FullName='" + this.txtTenantFullName.Text + "',Tenant_Email='" + this.txtTenantEmail.Text + "',Tenant_TelNum='" + this.txtTenantTelNum.Text + "',Tenant_EmName= '" + this.txtTenantEmName.Text + "',Tenant_EmNum= '" + this.txtTenantEmNum.Text + "',Tenant_WorkStatus= '" + this.txtWorkstatus.Text + "'Where Tenant_Email='" + Session["TenantLogin"] + "';", con); con.Open(); cmd.ExecuteNonQuery(); con.Close(); } Response.Redirect("TenantIndex.aspx"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)