G
Guest
Hello,
I have a search application to search data in tables in a database (3 sql
server tables). I populate 2 comboboxes with with data from each table. One
combobox will contain unique CompanyID's. The second combobox will contain
unique memberID's. Each of the tables that I have to search contain a
CompanyID and a memberID field, and these fields are not unique in the
respective tables. Like
CompanyID, MemberID
Clorox Smith
can exist several times in a table. Each table contains hundreds of
thousands to millions of rows.
Right now I use a dataAdapter to fill a dataTable (for each combobox) with
unique/distinct CompanyID and fill a combobox with unique/distinctMemberID
data for each table to be searched. Then I base the combo1.Datasource =
dataTable1.... When I switch tables, I was having to repopulate the
datasource tables for each combobox. Each combobox will contain around
40,000 unique ID's per table to be searched. This was taking way too long.
So then I thought since I have to search 3 Tables (each contains CompanyID
and MemberID fields), I would populate 6 dataTables when the application
first opens up. Then I could switch the datasource of each combobox as
needed. Ths was still taking a while. So my last effort was to have 6
individual comboboxes (placed on top of each other) populate them all at the
opening of the application and make them visible only according to the table
being searched at the time. But now I have all this data in memory.
If memory isn't an issue (like each workstation that would use this search
app would contain 2 gigs of memory a piece) would loading up 6 comboboxes
with 40,000 items apiece all at once be a reasonable practice? Or if there
is a better/more correct way to do this - could someone tell me what this way
is?
Thanks,
Rich
I have a search application to search data in tables in a database (3 sql
server tables). I populate 2 comboboxes with with data from each table. One
combobox will contain unique CompanyID's. The second combobox will contain
unique memberID's. Each of the tables that I have to search contain a
CompanyID and a memberID field, and these fields are not unique in the
respective tables. Like
CompanyID, MemberID
Clorox Smith
can exist several times in a table. Each table contains hundreds of
thousands to millions of rows.
Right now I use a dataAdapter to fill a dataTable (for each combobox) with
unique/distinct CompanyID and fill a combobox with unique/distinctMemberID
data for each table to be searched. Then I base the combo1.Datasource =
dataTable1.... When I switch tables, I was having to repopulate the
datasource tables for each combobox. Each combobox will contain around
40,000 unique ID's per table to be searched. This was taking way too long.
So then I thought since I have to search 3 Tables (each contains CompanyID
and MemberID fields), I would populate 6 dataTables when the application
first opens up. Then I could switch the datasource of each combobox as
needed. Ths was still taking a while. So my last effort was to have 6
individual comboboxes (placed on top of each other) populate them all at the
opening of the application and make them visible only according to the table
being searched at the time. But now I have all this data in memory.
If memory isn't an issue (like each workstation that would use this search
app would contain 2 gigs of memory a piece) would loading up 6 comboboxes
with 40,000 items apiece all at once be a reasonable practice? Or if there
is a better/more correct way to do this - could someone tell me what this way
is?
Thanks,
Rich