Hi people,
I'm a newbie in C# Development.
I have a problem with these lines of code:
...
SqlConnection c = new SqlConnection(M ainForm.connect ion);
c.Open();
SqlCommand cmd = new SqlCommand("SEL ECT id, ragione_sociale , indirizzo, cap, città, provincia FROM cliente", c);
c.Close();
da = new SqlDataAdapter( cmd);
SqlCommandBuild er cb = new SqlCommandBuild er(da);
ds = new DataSet();da.Fi ll(ds,"cliente" );
// textBox
txtId.DataBindi ngs.Add("Text", ds,"cliente.id" );
txtRagione_soci ale.DataBinding s.Add("Text",ds ,"cliente.ragio ne_sociale");
}
// Simple button SAVE in the form
void Button1Click(ob ject 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!!!
I'm a newbie in C# Development.
I have a problem with these lines of code:
...
SqlConnection c = new SqlConnection(M ainForm.connect ion);
c.Open();
SqlCommand cmd = new SqlCommand("SEL ECT id, ragione_sociale , indirizzo, cap, città, provincia FROM cliente", c);
c.Close();
da = new SqlDataAdapter( cmd);
SqlCommandBuild er cb = new SqlCommandBuild er(da);
ds = new DataSet();da.Fi ll(ds,"cliente" );
// textBox
txtId.DataBindi ngs.Add("Text", ds,"cliente.id" );
txtRagione_soci ale.DataBinding s.Add("Text",ds ,"cliente.ragio ne_sociale");
}
// Simple button SAVE in the form
void Button1Click(ob ject 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!!!
Comment