473,382 Members | 1,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Large Datasets and Comboboxes

Hi All,

I need some advice. I have a table in MSDE2000 with about 3 million records.
It's a city database. What I want to do is have 3 comboboxes on a form. The
first would be to select a country, second, to select a region (state,
province, etc) in that country, and the third would be a list of cities in
the selected region.

I don't want 3 million records in my dataset, but I can't figure out how to
set things up so that I'm only getting the records I need. The table has
several columns: Index, CountryCode, Country, RegionCountry, Region, City
(example: 1, US, United States, PA, US, PA, Philadelphia)
I'm using VB 2005 (for now) and I can't figure out how to setup a set or
queries that will give me the data I want without loading all of the records
into the record set first. If I setup queries in the DB, they need to be
parameterized, and I also can't figure out how to do that, but I think
that's the only way that I can keep from having all the records in the table
loaded into my dataset.

Can someone provide me with a bit of guidance?

thanks!
Lee

Nov 21 '05 #1
1 2458
In message <#U**************@TK2MSFTNGP12.phx.gbl>, lgbjr
<lg***@nospam.com> writes
Hi All,

I need some advice. I have a table in MSDE2000 with about 3 million records.
It's a city database. What I want to do is have 3 comboboxes on a form. The
first would be to select a country, second, to select a region (state,
province, etc) in that country, and the third would be a list of cities in
the selected region.

I don't want 3 million records in my dataset, but I can't figure out how to
set things up so that I'm only getting the records I need. The table has
several columns: Index, CountryCode, Country, RegionCountry, Region, City
(example: 1, US, United States, PA, US, PA, Philadelphia)


The common approach for this type of scenario is to re-post the form
when a Combo box changes its value to get the information required for
the next Combo box. While this creates round-trips to the server, you
are only fetch the small amount of data required.

For example:

1. Page loads for first time and the Country Combo box is filled using
"SELECT DISTINCT CountryCode, Country FROM MyTable". When the user
selects the Country required the page is reposted with that selection
and we go to step 2.

2. Page loads as step 1 however as well as filling Country Combo we
make sure users previous selection is automatically selected. We also
now fill the Region Combo using "SELECT DISTINCT RegionCountry, Region
FROM MyTable WHERE CountryCode='[UsersChoice]'". When the user selects
the Region required the page is reposted with that selection (and 1) and
we go to step 3.

3. Page loads as step 2 however as well as filling Country and Region
Combos we make sure users previous selections are automatically
selected. We also now fill the City Combo using "SELECT DISTINCT City
FROM MyTable WHERE CountryCode='[UsersChoice]' AND
RegionCountry='[UsersChoice]' ".

4. Finially we post all the criteria back to perform whatever needs
doing.

While this creates work for you as a developer, the experience form the
users perspective is slick (ie: they do not have to wait around) as you
are only fetching small amounts of data with each visit to the server
(they are not waiting for 3 million records to download).

Kind Regards,

--
Andrew D. Newbould E-Mail: ne********@NOSPAMzadsoft.com

ZAD Software Systems Web : www.zadsoft.com
Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: Salad | last post by:
Every now and then I see ads that state something like "Experience with Large Databases ...multi-gig...blah-de-blah" And I have to laugh. What's the difference between a large or small database? ...
8
by: Grant | last post by:
Sorry for all the posts - Im new to c# and oop and and having a tough time geting my head around some of this stuff. (I tell you Im surprised my monitor has lasted this long, Ive been tempted many...
8
by: Steve B. | last post by:
My Program: a local C# ADO.Net application using VS 2003 Right now I have about 5 ComboBox's which provides drop down selection entries from the same MS-Access table via a DataConnection,...
0
by: Sanjay | last post by:
I have a question whose answer will help me save a lot of time in investigation and implementation. Becuase we have a mix of platforms (Windows/Unix etc) in our environment I would like to...
3
by: Brent | last post by:
Hi, I'm wondering if it is good to use datasets for large amounts of data with many users. I'm talking tables with 130,000 records and 15 columns. And we want current data, so no cached data....
3
by: vanvee | last post by:
Hi I have an application for my company's HR department where we store resumes for candidates we receive. I have an application that uses VB.Net and ADO.Net and data bindings (through code) to...
4
by: Chris Fulstow | last post by:
Hi all, I'm investigating the best approach for building an n-tier web application with ASP.NET 2.0. I want to separate my data access layer, so an ObjectDataSource seems the natural choice,...
5
by: Rich | last post by:
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...
0
by: massenza | last post by:
All, Still a newbie, could someone help me out with this. When I load/Open my form my comboboxes which are tied to datasets all have the first value of the dataset listed in the text area of the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.