473,385 Members | 1,780 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,385 software developers and data experts.

ComboBox DataSets Qty

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, DataAdapter and
DataSet datasource. Each CB has it's own DA and DS. When I tried to use the
same DS as the datadource for each of the five CB's, changing one of the CB's
selection affectd the other four CB's.

New business requirements require I increase the number of CB's from 5 to
about 100. What do I do? Do I create 100 DA and DS?

Steve
Nov 17 '05 #1
8 1946
Hi,
inline

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
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, DataAdapter
and
DataSet datasource. Each CB has it's own DA and DS. When I tried to use
the
same DS as the datadource for each of the five CB's, changing one of the
CB's
selection affectd the other four CB's.
Instead of using a different DataSource (DataSet) for each ComboBox, you can
use a different BindingContext :

comboBox1.BindingContext = new BindingContext();
comboBox1.DataSource = ds; // same datasource
comboBox1.DisplayMember = ....;

comboBox2 .BindingContext = new BindingContext();
comboBox2.DataSource = ds; // same datasource
comboBox2.DisplayMember = ....;

.....

This way the comboboxes will create different CurrencyManagers(which
mantains position) for the same datasource/datamember and allow independent
navigating.
HTH,
greetings


New business requirements require I increase the number of CB's from 5 to
about 100. What do I do? Do I create 100 DA and DS?

Steve

Nov 17 '05 #2
Hi,
inline

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
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, DataAdapter
and
DataSet datasource. Each CB has it's own DA and DS. When I tried to use
the
same DS as the datadource for each of the five CB's, changing one of the
CB's
selection affectd the other four CB's.
Instead of using a different DataSource (DataSet) for each ComboBox, you can
use a different BindingContext :

comboBox1.BindingContext = new BindingContext();
comboBox1.DataSource = ds; // same datasource
comboBox1.DisplayMember = ....;

comboBox2 .BindingContext = new BindingContext();
comboBox2.DataSource = ds; // same datasource
comboBox2.DisplayMember = ....;

.....

This way the comboboxes will create different CurrencyManagers(which
mantains position) for the same datasource/datamember and allow independent
navigating.
HTH,
greetings


New business requirements require I increase the number of CB's from 5 to
about 100. What do I do? Do I create 100 DA and DS?

Steve

Nov 17 '05 #3
Bart

Thank You for responding. Great Idea. Will try it this weekend.

One question, the DataSource and DisplayMember assignments are in VS CB
properties window. Where do I put the comboBox1.BindingContext = new
BindingContext() statement so I get it in the order you specified or can I
put it anywhere (i.e. Constuctor, form Load() event)? Can I somehow get "new
BindingContext()" into the VS CB (DataBinding) block ?? Or do I remove the
CB DataSource and DisplayMemeber and put it all in my code after the
InitializeComponent();

Steve

"Bart Mermuys" wrote:
Hi,
inline

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
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, DataAdapter
and
DataSet datasource. Each CB has it's own DA and DS. When I tried to use
the
same DS as the datadource for each of the five CB's, changing one of the
CB's
selection affectd the other four CB's.


Instead of using a different DataSource (DataSet) for each ComboBox, you can
use a different BindingContext :

comboBox1.BindingContext = new BindingContext();
comboBox1.DataSource = ds; // same datasource
comboBox1.DisplayMember = ....;

comboBox2 .BindingContext = new BindingContext();
comboBox2.DataSource = ds; // same datasource
comboBox2.DisplayMember = ....;

.....

This way the comboboxes will create different CurrencyManagers(which
mantains position) for the same datasource/datamember and allow independent
navigating.
HTH,
greetings


New business requirements require I increase the number of CB's from 5 to
about 100. What do I do? Do I create 100 DA and DS?

Steve


Nov 17 '05 #4
Bart

Thank You for responding. Great Idea. Will try it this weekend.

One question, the DataSource and DisplayMember assignments are in VS CB
properties window. Where do I put the comboBox1.BindingContext = new
BindingContext() statement so I get it in the order you specified or can I
put it anywhere (i.e. Constuctor, form Load() event)? Can I somehow get "new
BindingContext()" into the VS CB (DataBinding) block ?? Or do I remove the
CB DataSource and DisplayMemeber and put it all in my code after the
InitializeComponent();

Steve

"Bart Mermuys" wrote:
Hi,
inline

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
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, DataAdapter
and
DataSet datasource. Each CB has it's own DA and DS. When I tried to use
the
same DS as the datadource for each of the five CB's, changing one of the
CB's
selection affectd the other four CB's.


Instead of using a different DataSource (DataSet) for each ComboBox, you can
use a different BindingContext :

comboBox1.BindingContext = new BindingContext();
comboBox1.DataSource = ds; // same datasource
comboBox1.DisplayMember = ....;

comboBox2 .BindingContext = new BindingContext();
comboBox2.DataSource = ds; // same datasource
comboBox2.DisplayMember = ....;

.....

This way the comboboxes will create different CurrencyManagers(which
mantains position) for the same datasource/datamember and allow independent
navigating.
HTH,
greetings


New business requirements require I increase the number of CB's from 5 to
about 100. What do I do? Do I create 100 DA and DS?

Steve


Nov 17 '05 #5
Hi,

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com...
Bart

Thank You for responding. Great Idea. Will try it this weekend.

One question, the DataSource and DisplayMember assignments are in VS CB
properties window. Where do I put the comboBox1.BindingContext = new
BindingContext() statement so I get it in the order you specified or can I
put it anywhere (i.e. Constuctor, form Load() event)? Can I somehow get
"new
BindingContext()" into the VS CB (DataBinding) block ?? Or do I remove
the
CB DataSource and DisplayMemeber and put it all in my code after the
InitializeComponent();
It doesn't matter where you bind, from code or with the properties window.
The new BindingContext assignments can only be done in in code. A good
place would be after InitializeComponent() in the constructor.

If you want independent navigating, sorting and filtering, you can:
Create a different dataview for each combox and bind that ( from code or
designer ) .

If you only want independent navigating you can gain some performance:
Create a single dataview (designer or code) and bind that to all ComboBoxes
and then give each ComboBox a new BindingContext from code.
HTH,
greetings

Steve

"Bart Mermuys" wrote:
Hi,
inline

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
> 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, DataAdapter
> and
> DataSet datasource. Each CB has it's own DA and DS. When I tried to
> use
> the
> same DS as the datadource for each of the five CB's, changing one of
> the
> CB's
> selection affectd the other four CB's.


Instead of using a different DataSource (DataSet) for each ComboBox, you
can
use a different BindingContext :

comboBox1.BindingContext = new BindingContext();
comboBox1.DataSource = ds; // same datasource
comboBox1.DisplayMember = ....;

comboBox2 .BindingContext = new BindingContext();
comboBox2.DataSource = ds; // same datasource
comboBox2.DisplayMember = ....;

.....

This way the comboboxes will create different CurrencyManagers(which
mantains position) for the same datasource/datamember and allow
independent
navigating.
HTH,
greetings

>
> New business requirements require I increase the number of CB's from 5
> to
> about 100. What do I do? Do I create 100 DA and DS?
>
> Steve
>
>


Nov 17 '05 #6
Hi,

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com...
Bart

Thank You for responding. Great Idea. Will try it this weekend.

One question, the DataSource and DisplayMember assignments are in VS CB
properties window. Where do I put the comboBox1.BindingContext = new
BindingContext() statement so I get it in the order you specified or can I
put it anywhere (i.e. Constuctor, form Load() event)? Can I somehow get
"new
BindingContext()" into the VS CB (DataBinding) block ?? Or do I remove
the
CB DataSource and DisplayMemeber and put it all in my code after the
InitializeComponent();
It doesn't matter where you bind, from code or with the properties window.
The new BindingContext assignments can only be done in in code. A good
place would be after InitializeComponent() in the constructor.

If you want independent navigating, sorting and filtering, you can:
Create a different dataview for each combox and bind that ( from code or
designer ) .

If you only want independent navigating you can gain some performance:
Create a single dataview (designer or code) and bind that to all ComboBoxes
and then give each ComboBox a new BindingContext from code.
HTH,
greetings

Steve

"Bart Mermuys" wrote:
Hi,
inline

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
> 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, DataAdapter
> and
> DataSet datasource. Each CB has it's own DA and DS. When I tried to
> use
> the
> same DS as the datadource for each of the five CB's, changing one of
> the
> CB's
> selection affectd the other four CB's.


Instead of using a different DataSource (DataSet) for each ComboBox, you
can
use a different BindingContext :

comboBox1.BindingContext = new BindingContext();
comboBox1.DataSource = ds; // same datasource
comboBox1.DisplayMember = ....;

comboBox2 .BindingContext = new BindingContext();
comboBox2.DataSource = ds; // same datasource
comboBox2.DisplayMember = ....;

.....

This way the comboboxes will create different CurrencyManagers(which
mantains position) for the same datasource/datamember and allow
independent
navigating.
HTH,
greetings

>
> New business requirements require I increase the number of CB's from 5
> to
> about 100. What do I do? Do I create 100 DA and DS?
>
> Steve
>
>


Nov 17 '05 #7
Bart,

Again thank you for the free input

Yes, I do want sorting of the comboBox dropdown but didn't know how to do it
Not real familar dataview but have used it once or twice - need to check it
out.

"Bart Mermuys" wrote:
Hi,

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com...
Bart

Thank You for responding. Great Idea. Will try it this weekend.

One question, the DataSource and DisplayMember assignments are in VS CB
properties window. Where do I put the comboBox1.BindingContext = new
BindingContext() statement so I get it in the order you specified or can I
put it anywhere (i.e. Constuctor, form Load() event)? Can I somehow get
"new
BindingContext()" into the VS CB (DataBinding) block ?? Or do I remove
the
CB DataSource and DisplayMemeber and put it all in my code after the
InitializeComponent();


It doesn't matter where you bind, from code or with the properties window.
The new BindingContext assignments can only be done in in code. A good
place would be after InitializeComponent() in the constructor.

If you want independent navigating, sorting and filtering, you can:
Create a different dataview for each combox and bind that ( from code or
designer ) .

If you only want independent navigating you can gain some performance:
Create a single dataview (designer or code) and bind that to all ComboBoxes
and then give each ComboBox a new BindingContext from code.
HTH,
greetings

Steve

"Bart Mermuys" wrote:
Hi,
inline

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
> 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, DataAdapter
> and
> DataSet datasource. Each CB has it's own DA and DS. When I tried to
> use
> the
> same DS as the datadource for each of the five CB's, changing one of
> the
> CB's
> selection affectd the other four CB's.

Instead of using a different DataSource (DataSet) for each ComboBox, you
can
use a different BindingContext :

comboBox1.BindingContext = new BindingContext();
comboBox1.DataSource = ds; // same datasource
comboBox1.DisplayMember = ....;

comboBox2 .BindingContext = new BindingContext();
comboBox2.DataSource = ds; // same datasource
comboBox2.DisplayMember = ....;

.....

This way the comboboxes will create different CurrencyManagers(which
mantains position) for the same datasource/datamember and allow
independent
navigating.
HTH,
greetings
>
> New business requirements require I increase the number of CB's from 5
> to
> about 100. What do I do? Do I create 100 DA and DS?
>
> Steve
>
>


Nov 17 '05 #8
Bart

Hope your still there, It gets a little more differcult.

The db may already have a entry for that field that should be loaded as
ComboBox.text when the form opens. The user should also have a choice to
edit the field without changing the other 20 "charaCode" fields

From IntializeComponent() method:
this.charaCode1CB.DataBindings.Add(new System.Windows.Forms.Binding("Text",
this.csiDbDS, "Main.CharacteristicCodes1"));

Adding "charaCode1CB.BindingContext = new BindingContext();" seems to
remove that previous binding

Steve


"Bart Mermuys" wrote:
Hi,
inline

"Steve B." <St****@discussions.microsoft.com> wrote in message
news:82**********************************@microsof t.com...
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, DataAdapter
and
DataSet datasource. Each CB has it's own DA and DS. When I tried to use
the
same DS as the datadource for each of the five CB's, changing one of the
CB's
selection affectd the other four CB's.


Instead of using a different DataSource (DataSet) for each ComboBox, you can
use a different BindingContext :

comboBox1.BindingContext = new BindingContext();
comboBox1.DataSource = ds; // same datasource
comboBox1.DisplayMember = ....;

comboBox2 .BindingContext = new BindingContext();
comboBox2.DataSource = ds; // same datasource
comboBox2.DisplayMember = ....;

.....

This way the comboboxes will create different CurrencyManagers(which
mantains position) for the same datasource/datamember and allow independent
navigating.
HTH,
greetings


New business requirements require I increase the number of CB's from 5 to
about 100. What do I do? Do I create 100 DA and DS?

Steve


Nov 17 '05 #9

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

Similar topics

0
by: | last post by:
I have made a Visual Basic.NET Program that pull info from a Form with a ComboBox that pulls info from one table. Then when you click the save button it should update a different table in Sql...
0
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,...
4
by: Alpha | last post by:
I have a small Window application and through out the different forms I create a different dataset. At the begining I used the Tools to drag and drop the SqlDataAdapter, connection and dataset...
6
by: Dany P. Wu | last post by:
Hi everyone, As usual, weekend is tinkering time for students and I'm playing with combobox databinding for the first time. Previously I have always iterated through the records and added each...
1
by: redwebgeek | last post by:
Hi, I've been searching this one for two days so thought I give this a shot again. I have two datasets Dataset1 and Dataset2 Dataset1 populates a datagrid and dataset2 populates a combobox...
2
by: Phil | last post by:
I need to created a typed dataset for a xml flat file and bind that dataset to a combobox. I was able to do this in VS.Net 2003 easy enough, but can't get it to work in VS.Net 2005. I've come...
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...
8
by: =?Utf-8?B?RyBIdXN0aXM=?= | last post by:
This is the 2nd time posting so sorry for duplications. I am using VB.NT 2005 & a standard Combobox. I've been wracking my brain over this problem for a over a month & cannot seem to find a way to...
12
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.