Dear,
I have on a form a datagrid (datagrid1) which is filled by a dataset created
in the class Afwezigheid. A button "Alles" show the whole table in the
datagrid and when someone wants to change the data, I have to use a
sqldataadapter which has an Update method. But how can I link this all ?
Thank you very much,
Hugo Lefevre
Filling up the datagrid :
----------------------
Afwezigheid frmAfw = new Afwezigheid( out ds);
dataGrid1.SetDataBinding(ds, "Afwezigheid");
Creation of the dataset in the class Afwezigheid :
------------------------------------------------
public Afwezigheid(out DataSet ds)
{
SqlSelectie = "select * from Afwezigheid; ";
Database db = new Database();
SqlConnection conn = db.Opent();
SqlCommand cmd = new SqlCommand(SqlSelectie, conn);
SqlDataAdapter da = new SqlDataAdapter(SqlSelectie, conn);
ds = new DataSet();
da.Fill(ds, "Afwezigheid");
conn.Close();
}
What have I to do to write this code in the class Afwezigheid :
---------------------------------------------------------------
private void btnUpdate_Click(object sender, System.EventArgs e)
{
?????????????????????????????????????
}
public void DbUpdateAfw(DataSet ds)
{
da.Update(ds, "Afwezigheid");
}