Solved

Create an xml database for an application

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
DataGridView 2 29
how to add field in my script 2 24
MS SQL Database Generating XML using query 21 15
Visual Studio editor? 1 12
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now