which way is better

Posted on 2006-06-04
Last Modified: 2010-04-16
I am new to c#. I was wondering with is it better to open a dataset and include all your tables in it, and then just create bindings, and tableadapters on the fly, or is it better to have an empty dataset and load up the tables as needed. I am trying to figure out if I pull in everything at once and then filter inside of my code etc..
What is the standard way it is normally done.
Question by:ppearson3000
    LVL 5

    Expert Comment

    I wouldn't load up all the tables into a DataSet when your program starts because you would have 10000 tables.  I would only load up what you need for that given time.  This question is a little bit tricky, you can only answer it.  Depending on what you are doing, sometimes it's better to pull back more tables than you need because you know very likely the user will ask for it anyways.  In general, I would pull back only the data you need for now, if that becomes a performance issue, just try to fine tune it by pulling the data differently.

    For example, if you UI shows all the users in the system, I would only pull back users table.  When the user clicks on another section to show the inventory, I would pull back the desired inventory there.  At any time, I wouldn't pull back everything only pull back what the user asked for.  If the user didn't filter it, I would try to page it.


    LVL 1

    Accepted Solution

    the best way test the beter of (dataset  / dataset and load )
    run the first and second with cpu monitoring

    then see which is have smallest time to process task and size in ram


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    760 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

    12 Experts available now in Live!

    Get 1:1 Help Now