Solved

Create an xml database for an application

Posted on 2008-06-19
5
135 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

732 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