DataAdapter updated field

jackel

New Member
i am trying to update my table from a gridview, the code below shows me no errors but my tables doesnt update, what is the idea for my mistake?\[code\] private void button1_Click(object sender, EventArgs e) { try { conn.Open(); string updCommand = "Update Salary set Salary = "+ds.Tables[0].Rows[0]["Salary"].ToString()+""; SqlCommand sqlcmdUpd = new SqlCommand(updCommand, conn); da.UpdateCommand = sqlcmdUpd; sqlcmdUpd.ExecuteNonQuery(); SqlCommandBuilder cmb = new SqlCommandBuilder(da); da.Update(ds,sTable); lblErrorMsg.Text = "Updated"; } catch (Exception ex) { lblErrorMsg.Text = ex.Message.ToString(); } finally { if (conn.State == ConnectionState.Open) { conn.Close(); } } }\[/code\]
 
Top