473,320 Members | 2,012 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,320 software developers and data experts.

Comboboxes loading datasource too many times

I have a form with tabpages on them. On one tabpage I have three
comboboxes all of which derive their datasource from the same table:-
TimePeriodID TimePeriod
1. Day(s)
2. Week(s)
3. Month(s)
4. Year(s)
When binding the fields for this form, I fill three sqldataadapters
with the data from this table.

I then set the datasource, valuemember, displaymember and databindings
properties of each combobox. Each combobox is of course bound to
different fields on the same tabpage.

What I find on running the form however, is that each combobox has
performed a "Union Query" on the datasource. That is the values of
the datasource have been loaded three times. So in the example above
I have TimePeriodID 1-4, followed by TimePeriodID 1-4, followed by
TimePeriodID 1-4.

Can anyone help me out of this little conundrum?

Richard



Nov 21 '05 #1
2 1181
You are filling the same datatable three times.

Create separate datatables...one for each combobox.

Then set the datasource for each combobox to the separate datatable.

"Richard" wrote:
I have a form with tabpages on them. On one tabpage I have three
comboboxes all of which derive their datasource from the same table:-
TimePeriodID TimePeriod
1. Day(s)
2. Week(s)
3. Month(s)
4. Year(s)
When binding the fields for this form, I fill three sqldataadapters
with the data from this table.

I then set the datasource, valuemember, displaymember and databindings
properties of each combobox. Each combobox is of course bound to
different fields on the same tabpage.

What I find on running the form however, is that each combobox has
performed a "Union Query" on the datasource. That is the values of
the datasource have been loaded three times. So in the example above
I have TimePeriodID 1-4, followed by TimePeriodID 1-4, followed by
TimePeriodID 1-4.

Can anyone help me out of this little conundrum?

Richard



Nov 21 '05 #2
Aah! Thank you.

On Mon, 1 Aug 2005 08:46:18 -0700, "Charlie" <cfarrier at
charlesfarriersoftware.com> wrote:
You are filling the same datatable three times.

Create separate datatables...one for each combobox.

Then set the datasource for each combobox to the separate datatable.

"Richard" wrote:
I have a form with tabpages on them. On one tabpage I have three
comboboxes all of which derive their datasource from the same table:-
TimePeriodID TimePeriod
1. Day(s)
2. Week(s)
3. Month(s)
4. Year(s)
When binding the fields for this form, I fill three sqldataadapters
with the data from this table.

I then set the datasource, valuemember, displaymember and databindings
properties of each combobox. Each combobox is of course bound to
different fields on the same tabpage.

What I find on running the form however, is that each combobox has
performed a "Union Query" on the datasource. That is the values of
the datasource have been loaded three times. So in the example above
I have TimePeriodID 1-4, followed by TimePeriodID 1-4, followed by
TimePeriodID 1-4.

Can anyone help me out of this little conundrum?

Richard




Nov 21 '05 #3

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

Similar topics

1
by: Nikhil Patel | last post by:
Hi All, I am using a dll function that returns a two diamensional array containing BankNames and RoutingIds. I need to display BankNames and RoutingIds in two different comboboxes. When user...
5
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. ...
11
by: Steve B. | last post by:
How can I keep the ComboBox textbox empty of datasource items when my local application starts AND keep them empty even after the user clicks different Tabs on the form. I welcome any questions....
1
by: Marcin Podle¶ny | last post by:
Hi, I've a form with three comboboxes. Each of them contains the same data - all cities in my country. As you see it's a lot of data so it takes a lot of memory. I'd like to use the same...
0
by: mjsterz | last post by:
I've been working with VB .NET for less than a year and this is the first time I've posted on one of these groups, so let me apologize beforehand if I'm being unclear, not posting my issue...
4
by: ECathell | last post by:
I am trying to databind 2 combo boxes to the same datasource but different fields using the same lookup table. The information in combobox2 is duplicating combobox 1(ie it appears to be gathering the...
5
by: Anthony Bollinger | last post by:
I have two tables in a master-detail relationship. When I make a selection in one combobox, how do I have it display the values from a second combobox? Each table has a key and a text value for...
0
by: theleshie | last post by:
Hi, I am creating an application which dynamically creates forms depending on the information held in a dataset (which also includes the data the application itself uses). As part of dynamically...
1
by: Alex | last post by:
Hi, I have a strange question... I have a series of combo boxes being populated by the same dataset, and I've noticed if one is changed then all change as well. I'm using Visual Basic 2005 and...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.