G
Guest
Can anyone help on this? I am using the following code to fill the dataset
and serialize it to a string and pass string to a web service.
In the web service I de-serialize it and do update, however that does not
put data into table because rowState=Unchanged.
Web Service Call:
//daSR.AcceptChangesDuringFill = false;
daSR.Fill(dsSR, "myTable");
dsSR.AcceptChanges();
System.IO.MemoryStream stream = new System.IO.MemoryStream();
dsSR.WriteXml(new System.Xml.XmlTextWriter(stream, null),
XmlWriteMode.DiffGram);
stream.Position = 0;
System.IO.StreamReader sr = new System.IO.StreamReader(stream);
string dataStream = sr.ReadToEnd();
myWS.Service ws = new myWS.Service();
ws.Save(dataStream);
... update dsSR and update to Table
In Web Service:
System.IO.TextReader sr = new System.IO.StringReader(dataStream);
dsWS.ReadXml(sr, XmlReadMode.DiffGram);
taSR.Update(dsWS);
and serialize it to a string and pass string to a web service.
In the web service I de-serialize it and do update, however that does not
put data into table because rowState=Unchanged.
Web Service Call:
//daSR.AcceptChangesDuringFill = false;
daSR.Fill(dsSR, "myTable");
dsSR.AcceptChanges();
System.IO.MemoryStream stream = new System.IO.MemoryStream();
dsSR.WriteXml(new System.Xml.XmlTextWriter(stream, null),
XmlWriteMode.DiffGram);
stream.Position = 0;
System.IO.StreamReader sr = new System.IO.StreamReader(stream);
string dataStream = sr.ReadToEnd();
myWS.Service ws = new myWS.Service();
ws.Save(dataStream);
... update dsSR and update to Table
In Web Service:
System.IO.TextReader sr = new System.IO.StringReader(dataStream);
dsWS.ReadXml(sr, XmlReadMode.DiffGram);
taSR.Update(dsWS);