Typed Dataset Question #2

Hello All,

I am creating a Windows Forms application (VS2005 and .Net 2.0) and I have a question regarding the best time / event to use to populate the form dataset.

In most cases, the rowcount for the datatable in the dataset will be less than 200. In a few datatables however, there is the potential for hundreds of thousands (if not millions) of records.

My questions are, "Do you use the form load event to populate the datatable " "What would the response be like during the form load if it was populating 1.2 million rows into a datatable " "Any better ideas on how to fill a large datatable "

Thanks in advance.

Roger



Answer this question

Typed Dataset Question #2

  • Siva116

    You can use the forms constructor...I personally like to keep the forms constructor as clean as possible...You also have the ability to drop the components on your form during design time so the initialize components routine will create the instance for you....All of that really starts be a personal preference...If you like working with the Visual Designer I would suggest dropping the components on the form during design time....otherwise create your instances in the load event...or if you wish in Sub New

  • Tigers21

    What about the form constructor I see a lot of examples where they use the constructor to create an instance of the table adapter and the typed data set. Then they fill the dataset and configure the data source and data member of the binding source.

    Is that as effecient as using the form load event


  • Kevin Tough

    If it is only a few hundred records then yes the form load event is the place to fill the dataset

    As far as working with millions or even hundreds of thousands of records...you need to impliment a paging mechanism for your users...in other words you still only load a few hundred records at a time for the user and when the user reaches the end of the datarows....you fill it with the next few hundred records and so on....



  • Typed Dataset Question #2