Hi people,
I'm a newbie in C# Development.
I have a problem with these lines of code:
...
SqlConnection c = new SqlConnection(MainForm.connection);
c.Open();
SqlCommand cmd = new SqlCommand("SELECT id, ragione_sociale, indirizzo, cap, cittą, provincia FROM cliente", c);
c.Close();
da = new SqlDataAdapter(cmd);
SqlCommandBuilder cb = new SqlCommandBuilder(da);
ds = new DataSet();da.Fill(ds,"cliente");
// textBox
txtId.DataBindings.Add("Text",ds,"cliente.id");
txtRagione_sociale.DataBindings.Add("Text",ds,"cli ente.ragione_sociale");
}
// Simple button SAVE in the form
void Button1Click(object sender, EventArgs e)
{
da.Update(ds, "cliente");
this.Close();
}
Why this lines doesn't update database after modify textBox???
I've used Update command in many parts of my application and it works fine (i.e. DataGridView).
Thank you!!!