string sqlQuery= "Update EmpDetails set Name='" + TextBox1.Text + "' where EmpId=" + empId.ToString(); SqlCommand cmd = new SqlCommand(sqlQuery, con1);