Database retrieval to forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • olblue
    New Member
    • Jan 2007
    • 1

    Database retrieval to forms

    I'm very new to VB.NET so basic stuff please. What I'm trying to do is this - I have a flat file of about 100,000 records. I want to display those records on a form depending on certain user selections. I don't like data grids. User may select one of five different combo boxes, and the rest of the data for that record must be displayed in various text boxes. This is all very simple in good old Sunbelt PLB.

    What I've tried so far is to create an Access database, and then use OleDbDataAdapte r, OleDataConnecti on and the SQL thingy to do a .Clear and then a .Fill into my form. It takes for ever, so I'm sure this is not a good option, but the first record displays and is sorted on the first of my combo boxes. (How do I get the other combo boxes sorted in their order as well?). If I then change the value of the first combo box, the other combo boxes change to the correct record, but nothing happens to the text boxes. I obviously can't do a .Fill every time because of the number of records.

    Has anybody got any ideas for a real novice?
  • enreil
    New Member
    • Jan 2007
    • 86

    #2
    The following article provides a good overview of VB.NET's DataSet, which you'll want to be quite familiar with if you are doing work with databases in VB.NET. Even if you don't like datagrids, a dataset provides a disconnected, in-memory copy of your data, which greatly reduces unnecessary overhead. This article may set you looking in the right direction. If not, you know where to come!

    ADO.NET was designed to meet the needs of this new programming model: disconnected data architecture, tight integration with XML, common data representation with the ability to combine data from multiple and varied data sources, and optimized facilities for interacting with a database, all native to the .NET Framework.


    Originally posted by olblue
    I'm very new to VB.NET so basic stuff please. What I'm trying to do is this - I have a flat file of about 100,000 records. I want to display those records on a form depending on certain user selections. I don't like data grids. User may select one of five different combo boxes, and the rest of the data for that record must be displayed in various text boxes. This is all very simple in good old Sunbelt PLB.

    What I've tried so far is to create an Access database, and then use OleDbDataAdapte r, OleDataConnecti on and the SQL thingy to do a .Clear and then a .Fill into my form. It takes for ever, so I'm sure this is not a good option, but the first record displays and is sorted on the first of my combo boxes. (How do I get the other combo boxes sorted in their order as well?). If I then change the value of the first combo box, the other combo boxes change to the correct record, but nothing happens to the text boxes. I obviously can't do a .Fill every time because of the number of records.

    Has anybody got any ideas for a real novice?

    Comment

    • kenobewan
      Recognized Expert Specialist
      • Dec 2006
      • 4871

      #3
      You have a data management problem that requires careful planning of your application. A dataset is a good way to handle the data, however your application will run better if you don't have to download/ sort all 100,000 records. So my suggestion is to design the form so that the user has a range of options to select, e.g. last x records or records between certain date range. Then do your database connection and create your dataset from this reduced number of records. Your application should run faster and the user will find it easier to get the info they want...

      Hope that this helps.

      Comment

      Working...