G
Guest
Hello,
The following code work but not exactly the way I want. This code gets data
from a table to dataset, update dataset and send it to another method over
web service and write data back to table.
However myTable is not updated but inserted. I would assume it is because of
the line
da.AcceptChangesDuringFill = false;
however if I change that to “true†the web service could not merge this
passed dataset to its own dataset. Any solution to this problem?
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
da.AcceptChangesDuringFill = false;
da.Fill(ds, "myTable");
for (int i = 0; i < ds.Tables["myTable"].Rows.Count; i++)
{
ds.Tables["myTable"].Rows["DRR"] = "Test";
}
myWS.Service ws = new myWS.Service();
ws.WSs(ds);
da.Update(ds, "myTable");
dataGridView2.DataSource = ds;
dataGridView2.DataMember = "myTable";
this is what WS does:
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
da.AcceptChangesDuringFill = false;
da.Fill(ds, "myTable");
// dsSent is the passed ds
ds.Merge(dsSent, false);
da.Update(ds, "myTable");
The following code work but not exactly the way I want. This code gets data
from a table to dataset, update dataset and send it to another method over
web service and write data back to table.
However myTable is not updated but inserted. I would assume it is because of
the line
da.AcceptChangesDuringFill = false;
however if I change that to “true†the web service could not merge this
passed dataset to its own dataset. Any solution to this problem?
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
da.AcceptChangesDuringFill = false;
da.Fill(ds, "myTable");
for (int i = 0; i < ds.Tables["myTable"].Rows.Count; i++)
{
ds.Tables["myTable"].Rows["DRR"] = "Test";
}
myWS.Service ws = new myWS.Service();
ws.WSs(ds);
da.Update(ds, "myTable");
dataGridView2.DataSource = ds;
dataGridView2.DataMember = "myTable";
this is what WS does:
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
da.AcceptChangesDuringFill = false;
da.Fill(ds, "myTable");
// dsSent is the passed ds
ds.Merge(dsSent, false);
da.Update(ds, "myTable");