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. Singleton Pattern : Using a single dataSet in all over of application.

Singleton Pattern : Using a single dataSet in all over of application.

Scheduled Pinned Locked Moved C#
databasequestionhtmlvisual-studiocom
5 Posts 5 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.
  • H Offline
    H Offline
    hdv212
    wrote on last edited by
    #1

    Hi i've wrote a sample database app, which use a single dataSet object in all over of the application (It's static). when a form open, the appropriate table of that dataset fill out and when form closing, that table clear. my question is that Is this best practise (where performance & overhead is important) ? u can download it via this link (http://rapidshare.com/files/227688281/Sample_Singleton_Pattern.rar.html[^]). plz run and test it and tell me your comments. Notes : 1. Plz first execute DbScript.sql to create 'Test' database and stored procedures 2. Use vs 2008 to work with sample project. 3. Change connection string in app.config. i'm waiting for your comments. Thanks

    R P L 3 Replies Last reply
    0
    • H hdv212

      Hi i've wrote a sample database app, which use a single dataSet object in all over of the application (It's static). when a form open, the appropriate table of that dataset fill out and when form closing, that table clear. my question is that Is this best practise (where performance & overhead is important) ? u can download it via this link (http://rapidshare.com/files/227688281/Sample_Singleton_Pattern.rar.html[^]). plz run and test it and tell me your comments. Notes : 1. Plz first execute DbScript.sql to create 'Test' database and stored procedures 2. Use vs 2008 to work with sample project. 3. Change connection string in app.config. i'm waiting for your comments. Thanks

      R Offline
      R Offline
      Rolando CC
      wrote on last edited by
      #2

      I'm not saying that your job is bad. but... I know better ways to do that, LinQ for example is an excelente way to work with data...

      Preparing for 70-536

      1 Reply Last reply
      0
      • H hdv212

        Hi i've wrote a sample database app, which use a single dataSet object in all over of the application (It's static). when a form open, the appropriate table of that dataset fill out and when form closing, that table clear. my question is that Is this best practise (where performance & overhead is important) ? u can download it via this link (http://rapidshare.com/files/227688281/Sample_Singleton_Pattern.rar.html[^]). plz run and test it and tell me your comments. Notes : 1. Plz first execute DbScript.sql to create 'Test' database and stored procedures 2. Use vs 2008 to work with sample project. 3. Change connection string in app.config. i'm waiting for your comments. Thanks

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        Yeah, probably not the worst way, but not the best either. I very rarely use a DataSet at all; I think they were only created to make demonstrating VS and book writing easy. They're like VB; they make doing easy things appear even easier, but quality results require more robust/lower-level techniques.

        M 1 Reply Last reply
        0
        • P PIEBALDconsult

          Yeah, probably not the worst way, but not the best either. I very rarely use a DataSet at all; I think they were only created to make demonstrating VS and book writing easy. They're like VB; they make doing easy things appear even easier, but quality results require more robust/lower-level techniques.

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

          I actually needed a dataset recently, the proc was returning 2+ tables and was surprised my DAL had a method to support it. Datatables are the basic container in my DAL. I found performance dropped off dramatically when returning multiple tables from a single proc.

          Never underestimate the power of human stupidity RAH

          1 Reply Last reply
          0
          • H hdv212

            Hi i've wrote a sample database app, which use a single dataSet object in all over of the application (It's static). when a form open, the appropriate table of that dataset fill out and when form closing, that table clear. my question is that Is this best practise (where performance & overhead is important) ? u can download it via this link (http://rapidshare.com/files/227688281/Sample_Singleton_Pattern.rar.html[^]). plz run and test it and tell me your comments. Notes : 1. Plz first execute DbScript.sql to create 'Test' database and stored procedures 2. Use vs 2008 to work with sample project. 3. Change connection string in app.config. i'm waiting for your comments. Thanks

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

            If performance and overhead is important, then don't use datasets (IMHO). Use a datareader to get the data and populate objects (and collections thereof) and return them. Do whatever is required to the objects, and have methods to re-populate the DB from teh new values. Depending on your requirements you may need to have your objects implement interfaces or inherit from base classes that 'know' if they are new (to the DB) or have been changed - but that's fairly simple in most cases (again, without knowing the requirements it's difficult to judge) The important thing, I think, is that if performance and overhead are important, writing it yourself will always be more efficient (OK, assuming you write it well) than a 'generic' solution.

            ___________________________________________ .\\axxx (That's an 'M')

            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