Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3946566
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:08:54+00:00 2026-05-20T01:08:54+00:00

Visual Studio 2010 / SQL server 2008 I have two tables for parent xml

  • 0

Visual Studio 2010 / SQL server 2008

I have two tables for parent xml and child xml and they are related by key.
I am trying to generate a XML string by using Linq(or anything works) and those two tables.

Parent xml data : Country
Child xml data : USA, Mexico

I want to generate it like this way.

<Country>
   <USA>
   </USA>
   <Mexico>
   </Mexico>
</Country>

I have been tried with few ways but I could not figure out.
Does anybody has suggestion?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:08:55+00:00Added an answer on May 20, 2026 at 1:08 am

    The WriteXml method from the DataSet class should get you pretty close to what you want, and it’s a simple thing to do.

    In C#, it’s:

    private void WriteXmlToFile(DataSet thisDataSet) 
    {
       // Create a file name to write to.
       string filename = "myXmlDoc.xml";
    
       // Create the FileStream to write with.
       System.IO.FileStream myFileStream 
           = new System.IO.FileStream (filename, System.IO.FileMode.Create);
    
       // Write to the file with the WriteXml method.
    
       thisDataSet.WriteXml(myFileStream);   
    }
    

    So all you have to do is load up your DataSet with the appropriate data, and the WriteXml method should generate a fairly appropriate XML representation of that data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am going to install Visual Studio 2010 Premium. I have SQL Server 2008
We just recently switched from Visual Studio 2008 to Visual Studio 2010. I have
Tables have been created in our SQL Server 2008 R2 database on a local server,
I installed Visual Studio 2008 Professional in my machine and It had installed SQL
I have a Visual Studio 2010 Windows Forms application in which I start a
I have Microsoft SQL Server 2008 installed. It appears in the add/remove programs window.
I currently have Visual Studio 2008 Professional installed on my Windows 7 (x64) laptop.
I have an application that I'm developing in Visual Studio 2010 that utilizes a
Ii have a database (sql server 2008) and I am working with c# in
I don't have SQL Server Management Studio on my machine. I have a database

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.