CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2011
    Posts
    3

    Access DB/C#/XML

    I am finding it difficult to loop through a table using C# and output the file in XML to my anticipated format. Here is what I am trying to achieve. Let us assume my data (table) is below.

    col1, col2
    A , 1
    A , 2
    A , 3
    B , 1
    B , 2
    C , 1

    My xml output file should be something like

    A, 1, 2, 3
    B, 1, 2
    C, 1

    In other words if col1 repeats itself in the table then append col2. The example above seems straightforward but it is not the exact situation. The exact situation is in the attachments below.

    I have attached the original access database (db.accdb) that contains the tables, C# code (C#-code), xml output file after running the C# code (XML_data.xml), and anticipated output file (XML_data-Want.xml).

    The anticipated output file (XML_data-Want.xml) is the exact data I am trying to output using C#.

    Any help is greatly appreciated. Please do not just suggest answers. Provide the solution by giving me the exact C# code.

    Thanks again.
    Attached Files Attached Files

  2. #2
    Join Date
    Feb 2005
    Location
    Denmark
    Posts
    742

    Re: Access DB/C#/XML

    Quote Originally Posted by fizo20 View Post
    <snip>

    Any help is greatly appreciated. Please do not just suggest answers. Provide the solution by giving me the exact C# code.

    Thanks again.
    Sorry, but I don't do other peoples homework.
    If you wanted hints or suggestions - a forum like this is the place to go. If you want others to do your work; it's not the correct place.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured