Translating XML to database

  • Thread starter Thread starter krish
  • Start date Start date
K

krish

hello ,

i am working on ASP.NET & C#. I want to insert/update/delete some
datas to the database. the datas are based on the object. For example

class Person
{
string name, address, pincode;
};

i have related schema in the SQL Server database. can i store the
above class object to the database with out using SQL query for
insert/update/delete but using XML. because i need reusablity. if i do
it using sql i need to change my query every time when ever
modification of class.

can anyone help me please.

Thanks in advance.

krish
 
The trick is using DataSet.WriteXML("C:\Somefile") and
DataSet.ReadXML("C:\SomeFile") You can ouptut your query
to XML using the first, it's really that easy once your
Dataset is built. To Build a dataset from XML, it's just
the reverse. Once you have a dataset, you can iterate
through it and add the values, or any other mechanism your
want to get the data back into the database. It's pretty
easy though...I'm posting a link where I go through it in
a little more depth.

http://forums.devbuzz.com/tm.asp?
m=24284&p=2&tmode=1&smode=1

Let me know if you have any problems.

Good Luck,

Bill

W.G. Ryan
(e-mail address removed)
www.knowdotnet.com
 
Back
Top