Solved

Create an xml database for an application

Posted on 2008-06-19
5
134 Views
Last Modified: 2010-04-23
I have started a windows application and imported some file from sql server for the data source. I am thinking I may want to go a different way though. I am leaning towards using an xml database instead. Reason being I have been reading about read/write and I want to have (I hope) and pocket pc application to sync with the desktop application. I was researching xml on the web and it looks possible. I think this would be the best way to go.

I no nothing about even creating the xml file to start with. Can I take an existing table and use that? Should I just create the xml file from the form?

Any good tutorials would be appreciated.
0
Comment
Question by:wiswalld
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 19

Accepted Solution

by:
elimesika earned 500 total points
ID: 21823730
0
 
LVL 13

Author Comment

by:wiswalld
ID: 21824824
How would I create the original xml file from my current dataset in my application. If I have 4 tables and I want an xml file for the xml database
0
 
LVL 13

Author Comment

by:wiswalld
ID: 21824872
The original database was created in sql server ce 2005 (I know not the norm) and added to the project using add datasource. I then have 4 tables in my datasource. But I want to make them into xml
0
 
LVL 19

Expert Comment

by:elimesika
ID: 21828889
0
 
LVL 13

Author Comment

by:wiswalld
ID: 21833544
That does not looks like it create a new xml document (database). I know how to create a document from scratch like

 Dim colProd As New DataColumn("Player")
        colProd.ColumnMapping = MappingType.Attribute
        Dim col1 As New DataColumn("Handicap")
        col1.ColumnMapping = MappingType.Attribute
        Dim col2 As New DataColumn("PlayerID")
        col2.ColumnMapping = MappingType.Attribute
        Dim dt As New DataTable("tblHandicap")
        dt.Columns.AddRange(New DataColumn() {colProd, col1, col2})
        '*** Create rows and add to Table
        Dim row As DataRow
        row = dt.NewRow()
        row.Item("Player") = "John Doe"
        row.Item("Handicap") = "18"
        row.Item("PlayerID") = "2"
        dt.Rows.Add(row)

        '*** End create rows and add to Table

        '*** Write data out to file
        dt.WriteXml("c:\DVADGolf\DVADGolf.xml")
        MsgBox("Done")

I even know how to add data like

 Dim path As String = "c:\DVADGolf\DVADGolf.xml"

        Dim ds As New DataSet()
        ds.ReadXml(path)    'read the XML file into memory

        'Add a new record to the 1st table in the DataSet:
        Dim row As DataRow = ds.Tables(0).NewRow()

        'Update a value:
        row.Item(0) = Me.TextBox1.Text
        row.Item(1) = Me.textbox2.text
        row.Item(2) = Me.textbox3.text

        ds.Tables(0).Rows.Add(row)    '< add the row to the table

        'Write it back out again:
        ds.WriteXml(path, XmlWriteMode.WriteSchema)

        ds.Dispose()






Thats all good. But I imported an sdf file from sql server ce into a visual studio windows application creating a new dataset. I don't want to use that dataset just create an xml document (database) from that to use as my dataset. So another words I need an xml document with multiple tables.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with error in Query 2 39
Access Schema 6 45
Need help with a query 3 38
VB.Net  Exporting Excel Woorkbook to PDF 7 59
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question