[RESOLVED] Update Statement
hi everyone. I am trying to execute an update statement. I have tried what seems like 20 different ways and nothing seems to be working. Can someone please tell me what i am doing wrong.
int Employeenum = int.Parse(this.txtEmployeeNum.Text);
string BranchName = this.cboBranch.Text;
string sql = "update branch set num_employees = " + Employeenum + " where branch_name = '" + BranchName + "'";
SqlCommand cmd = new SqlCommand(sql, conn);
try
{
cmd.Connection.Open();
cmd.ExecuteNonQuery();
cmd.Connection.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
After that happens i get no update on the table and no errors.
:(