XML and Dataset

G

GTi

I have a result from webservice query:

XmlDocument doc = new XmlDocument();
XmlNode newSet = doc.ImportNode( [xmlnode from a WebService query] );
doc.DocumentElement.AppendChild(newSet);

I have the same database on my computer.
The problem is that this database don't have any primary keys.
Is there anyway I can load local database into a dataset and the
webservice into a dataset
and compare it and save the new changed dataset back to my local
computer ?

DataSet ds1 = new DataSet();
DataSet ds2 = new DataSet();

ds1 = [load dataset from local computer]
ds2 = doc.????? [get the xml to a DataSet]

ds1.Merge(ds2);

Save changes to local database.

Question Summary:
1) How to load a XmlDocument into a dataset
2) Is it possible to check any changes in this two dataset?
 
G

GTi

Maybe I don't need to insert it into a DataSet...
I can use the xml directly and manualy step thru the records and see if
there is any changes. If it can't be done with .NET 2.0
But is there a way of sorting the xml records?
 
R

Rudderius

the dataset might be a good way if you know the structure of your xml
well enough.

the dataset has a method to diretly load an xml file in it (LoadXml() i
guess)

greetz,
Rudderius
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top