Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Local sqlce database or datatable in xml file

Local sqlce database or datatable in xml file

Scheduled Pinned Locked Moved C#
databasexmlhelpcareer
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GrooverFromHolland
    wrote on last edited by
    #1

    Hi all, I have started a new WindowsForms project and I am wondering if there is a benefit to store my project data in a local SQLCE database or just store data table(s) in a xml file. The data-tables have a maximum of 9999 records and 150 columns. The data is used for auto-complete source(job number only) and to compare just one record from stored data with new data. the data does not change for hours. The data per column is 10 characters. I hope You can help me to choose and elaborate the pro's and cons. Groover

    0200 A9 23 0202 8D 01 80 0205 00

    M L 2 Replies Last reply
    0
    • G GrooverFromHolland

      Hi all, I have started a new WindowsForms project and I am wondering if there is a benefit to store my project data in a local SQLCE database or just store data table(s) in a xml file. The data-tables have a maximum of 9999 records and 150 columns. The data is used for auto-complete source(job number only) and to compare just one record from stored data with new data. the data does not change for hours. The data per column is 10 characters. I hope You can help me to choose and elaborate the pro's and cons. Groover

      0200 A9 23 0202 8D 01 80 0205 00

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Any table with 150 columns means you have a bad design! Having said that I would always go for a database solution but it may depend on your distribution requirements. Managing data in an XML file is dramatically more difficult than read/write to a database. You have difficulty maintaining any sort of relational integrity and reporting is painful.

      Never underestimate the power of human stupidity RAH

      G 1 Reply Last reply
      0
      • G GrooverFromHolland

        Hi all, I have started a new WindowsForms project and I am wondering if there is a benefit to store my project data in a local SQLCE database or just store data table(s) in a xml file. The data-tables have a maximum of 9999 records and 150 columns. The data is used for auto-complete source(job number only) and to compare just one record from stored data with new data. the data does not change for hours. The data per column is 10 characters. I hope You can help me to choose and elaborate the pro's and cons. Groover

        0200 A9 23 0202 8D 01 80 0205 00

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        In general, it will take a bit more effort to get up and running with SqlCE than with XML files (IMO). There is also usually a need to distribute extra runtime dll's with SqlCE. There is nothing in the description of your project that makes it obvious which is the better choice; and listing "pros and cons" that may have no bearing on your project seems pointless. If there are no obvious advantages (apparent to you), then go with the one that performs best relative to your current needs.

        G 1 Reply Last reply
        0
        • M Mycroft Holmes

          Any table with 150 columns means you have a bad design! Having said that I would always go for a database solution but it may depend on your distribution requirements. Managing data in an XML file is dramatically more difficult than read/write to a database. You have difficulty maintaining any sort of relational integrity and reporting is painful.

          Never underestimate the power of human stupidity RAH

          G Offline
          G Offline
          GrooverFromHolland
          wrote on last edited by
          #4

          Hi Mycroft, Having a table with 150 columns is a must, the data just has 150 parameters that can change. there is no need for reporting and no relations, just one or two tables, and distribution is to one workstation only. Groover

          0200 A9 23 0202 8D 01 80 0205 00

          1 Reply Last reply
          0
          • L Lost User

            In general, it will take a bit more effort to get up and running with SqlCE than with XML files (IMO). There is also usually a need to distribute extra runtime dll's with SqlCE. There is nothing in the description of your project that makes it obvious which is the better choice; and listing "pros and cons" that may have no bearing on your project seems pointless. If there are no obvious advantages (apparent to you), then go with the one that performs best relative to your current needs.

            G Offline
            G Offline
            GrooverFromHolland
            wrote on last edited by
            #5

            Hi Gerry, With the XML datafile I will have to store the datatable in memory and overwrite or create a new XML file with new or changed data. Wit SQLCE database I will have to deal with one record only. Groover

            0200 A9 23 0202 8D 01 80 0205 00

            L 1 Reply Last reply
            0
            • G GrooverFromHolland

              Hi Gerry, With the XML datafile I will have to store the datatable in memory and overwrite or create a new XML file with new or changed data. Wit SQLCE database I will have to deal with one record only. Groover

              0200 A9 23 0202 8D 01 80 0205 00

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Groover, You have identified a requirement that is important then. You are right: to "update" an Xml file, you will have to rewrite the entire file. If "updating" is a factor, then SqlCE is a better choice. Having committed to SqlCE, I would then also look at Entity Framework (EF) for your ORM and EF's "Code First" approach where you have EF generate the database for you based on your class / entity definitions. Gerry from Amersfoort.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups