Hy all,
I'm new at using sql server compact,so I don't know yet if what I want to do is possible:)?
I have the following setup:
1.Datatable created from a table from my database(this is the table that I want to update later);
2.Make modification on datatable and save it;
3.Bulk update table using the modified datatable;
Is it possible??Please help me..:)
This is what I've tried so far:
SqlCeConnection conn = new SqlCeConnection(connection);
SqlCeDataAdapter da = new SqlCeDataAdapter();
da.SelectCommand = new SqlCeCommand("select * from MyTable", conn);
SqlCeCommandBuilder cb = new SqlCeCommandBuilder(da);
DataSet ds = new DataSet();
da.Fill(ds, "MyTable");
DataTable dt = ds.Tables["MyTable"];
//modify datatabele;
dt.Rows[i].SetField("cui", cui);
dt.Rows[i].SetField("denumire", denumire);
dt.Rows[i].SetField("nr_reg_com", regCom);
dt.Rows[i].SetField("adresa", adresa);
dt.Rows[i].SetField("fax", fax);
da.update(ds,"MyTable");