?
Solved

Create an xml database for an application

Posted on 2008-06-19
5
Medium Priority
?
139 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 2000 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

Technology Partners: 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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

762 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