Advertisement

05.16.2008 at 01:25PM PDT, ID: 23409679
[x]
Attachment Details

Update Database From XML

Asked by smaguire in Microsoft Visual C#.Net, Visual Studio 2008

Tags: C#, Visual Studio 2008

hi,
I have the following scenario: I am using SQL Server 2005 Express and Visual Studio 2008 - C#, my database has 5 tables which hold configuration settings for my application. Each client will have a different configuration settings but the same database and same table structures. What I am trying to accomplish is to update the 5 tables in my database from one XML file.
Is there anyway I can update my database with ONLY one xml file instead of having 1 xml file per table?
I know that i need an sql adapter for each table, but can i write data from different sql adapters into ONE single xml file? if so, then how can I read them back into their detination tables?

I am trying to avoid having the client to Import/Export 5 xml files
here is the code i am using to import one singe xml file into a destination table
SqlDataAdapter da = new SqlDataAdapter("Select * from Table1", sqlcon);
.....
// read the XML file
ds.ReadXml("DestinationFile.xml");
// update the database
da.Update(ds, "Table1");

thank youStart Free Trial
 
 
[+][-]05.17.2008 at 08:53AM PDT, ID: 21589788

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05.19.2008 at 08:28AM PDT, ID: 21598630

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, Visual Studio 2008
Tags: C#, Visual Studio 2008
Sign Up Now!
Solution Provided By: smaguire
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628