473,729 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ComboBox - DataBinding and Sorting - Days Wasted!

Customers table - contains Columns:
CustID, Surname, Forename, TtlID

Titles table - contains Columns:
TtlID, Title

TtlID is a Foreign Key in the Customers table.

I have a Form frmCustomers which contains a ComboBox to select
the Customer's Title. The ComboBox is populated from the database
table Titles.

However, I want the titles in the combobox to be displayed in alphabetical
order so that when a title is selected and the Customer is updated, the
TtlID field correctly corresponds with that in the Titles table.

I've tried using a dataview and sorting it as the datasource for the
combobox, but once the data value are assigned to the combobox,
the TtlID field gets out of sync with the database table.

How can I solve this? - I've been trying for days!!!

Thank You in Advance for any help.

Jul 21 '05 #1
3 1989
Hello I hope this helps,

Let me explain, first, what I believe you are asking.

You have a Combobox that is populated from a database. When the user
selects a Title you have textboxes (visible or invisible) that are filled
that contain additional information that MUST correspond to the selected
Title. i.e.

This is a different Example:

You have a list of Clients

ComboBox TextBox1 TextBox2

Frank | Address Phone

James | Address Phone

Mark | Address Phone

Marcy | Address Phone

When James is selected the Address and Phone must also be selected and
placed inside TextBox1 and TextBox2.

Am I understanding you correctly. Let me know.

Chuck

"Paul Fairless" <pa**@fairlessh ouse.freeserve. co.uk> wrote in message
news:cc******** **@newsg4.svr.p ol.co.uk...
Customers table - contains Columns:
CustID, Surname, Forename, TtlID

Titles table - contains Columns:
TtlID, Title

TtlID is a Foreign Key in the Customers table.

I have a Form frmCustomers which contains a ComboBox to select
the Customer's Title. The ComboBox is populated from the database
table Titles.

However, I want the titles in the combobox to be displayed in alphabetical
order so that when a title is selected and the Customer is updated, the
TtlID field correctly corresponds with that in the Titles table.

I've tried using a dataview and sorting it as the datasource for the
combobox, but once the data value are assigned to the combobox,
the TtlID field gets out of sync with the database table.

How can I solve this? - I've been trying for days!!!

Thank You in Advance for any help.


Jul 21 '05 #2
Hi Charles

Sorry - I do not think we are talking about the same scenario:

Let me try and illustrate:

Database Table contains:

TtlID (PK) TITLE
1 Mr
2 Miss
3 Mrs

But when these are read into the combobox and sorted they become:

TtlID TITLE
0 Miss
1 Mr
2 Mrs

So when I update the database, the TtlID is incorrect!
Does that make sense?

Anyway - Thanks for replying.
"Charles A. Lackman" <Ch*****@cet.co m> wrote in message
news:uF******** *****@TK2MSFTNG P11.phx.gbl...
Hello I hope this helps,

Let me explain, first, what I believe you are asking.

You have a Combobox that is populated from a database. When the user
selects a Title you have textboxes (visible or invisible) that are filled
that contain additional information that MUST correspond to the selected
Title. i.e.

This is a different Example:

You have a list of Clients

ComboBox TextBox1 TextBox2

Frank | Address Phone

James | Address Phone

Mark | Address Phone

Marcy | Address Phone

When James is selected the Address and Phone must also be selected and
placed inside TextBox1 and TextBox2.

Am I understanding you correctly. Let me know.

Chuck

"Paul Fairless" <pa**@fairlessh ouse.freeserve. co.uk> wrote in message
news:cc******** **@newsg4.svr.p ol.co.uk...
Customers table - contains Columns:
CustID, Surname, Forename, TtlID

Titles table - contains Columns:
TtlID, Title

TtlID is a Foreign Key in the Customers table.

I have a Form frmCustomers which contains a ComboBox to select
the Customer's Title. The ComboBox is populated from the database
table Titles.

However, I want the titles in the combobox to be displayed in alphabetical order so that when a title is selected and the Customer is updated, the
TtlID field correctly corresponds with that in the Titles table.

I've tried using a dataview and sorting it as the datasource for the
combobox, but once the data value are assigned to the combobox,
the TtlID field gets out of sync with the database table.

How can I solve this? - I've been trying for days!!!

Thank You in Advance for any help.



Jul 21 '05 #3
Hello,

I have notice that another News Group has responded to your question in
Windows Controls. Did their answers solve your problem. If not let me
know, because there is another way using invisible textboxes to carry the
data whereever you wnat using databindings. I have used databindings with a
combobox to carry large amounts of data from multiple tables and multiple
columns based on the selected customer from a combobox.

Chuck

"Paul Fairless" <pa**@fairlessh ouse.freeserve. co.uk> wrote in message
news:cc******** **@news7.svr.po l.co.uk...
Hi Charles

Sorry - I do not think we are talking about the same scenario:

Let me try and illustrate:

Database Table contains:

TtlID (PK) TITLE
1 Mr
2 Miss
3 Mrs

But when these are read into the combobox and sorted they become:

TtlID TITLE
0 Miss
1 Mr
2 Mrs

So when I update the database, the TtlID is incorrect!
Does that make sense?

Anyway - Thanks for replying.
"Charles A. Lackman" <Ch*****@cet.co m> wrote in message
news:uF******** *****@TK2MSFTNG P11.phx.gbl...
Hello I hope this helps,

Let me explain, first, what I believe you are asking.

You have a Combobox that is populated from a database. When the user
selects a Title you have textboxes (visible or invisible) that are filled
that contain additional information that MUST correspond to the selected
Title. i.e.

This is a different Example:

You have a list of Clients

ComboBox TextBox1 TextBox2

Frank | Address Phone

James | Address Phone

Mark | Address Phone

Marcy | Address Phone

When James is selected the Address and Phone must also be selected and
placed inside TextBox1 and TextBox2.

Am I understanding you correctly. Let me know.

Chuck

"Paul Fairless" <pa**@fairlessh ouse.freeserve. co.uk> wrote in message
news:cc******** **@newsg4.svr.p ol.co.uk...
Customers table - contains Columns:
CustID, Surname, Forename, TtlID

Titles table - contains Columns:
TtlID, Title

TtlID is a Foreign Key in the Customers table.

I have a Form frmCustomers which contains a ComboBox to select
the Customer's Title. The ComboBox is populated from the database
table Titles.

However, I want the titles in the combobox to be displayed in

alphabetical order so that when a title is selected and the Customer is updated, the TtlID field correctly corresponds with that in the Titles table.

I've tried using a dataview and sorting it as the datasource for the
combobox, but once the data value are assigned to the combobox,
the TtlID field gets out of sync with the database table.

How can I solve this? - I've been trying for days!!!

Thank You in Advance for any help.




Jul 21 '05 #4

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

Similar topics

8
1981
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, 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...
2
1539
by: Dica | last post by:
i've got a dataSet that looks like the following: <tblTasks> <id>0</id> <summary>-- Select A Task--</summary> </tblTasks>
5
9163
by: Eric A. Johnson | last post by:
Hi Everyone, I am at my wit's end here. I have a combobox (combyQueryTitle) that I need to use in order to select a query for my database project. Therefore, I am using the comboQueryTitle_SelectedIndexChanged handler to, when a new selection is made, update the query and refresh the display. The only problem is that the program seems to inexplicably start with the ..selectedindex property at -1! This makes no sense to me. ...
3
262
by: Paul Fairless | last post by:
Customers table - contains Columns: CustID, Surname, Forename, TtlID Titles table - contains Columns: TtlID, Title TtlID is a Foreign Key in the Customers table. I have a Form frmCustomers which contains a ComboBox to select the Customer's Title. The ComboBox is populated from the database
0
1298
by: Simon Gregory | last post by:
I am currently attempting to figure out how the new databinding stucture works in ASP.NET 2.0 after working with v1.0 & v1.1 for several years. It seems that if you wish to do set up databinding at Design Time, you are restricted to using one of the 5 xxxDataSource controls. The data in our websites are usually obtained via a set of webservices and are contained in a set of strongly typed relational DataSets.
8
26433
by: | last post by:
I am sure this has been asked and answered, but here goes anyway... VS.Net 2005, VB.Net How can you display more than one field in the displaymember property of a combobox inside the datagridview control? I am at a loss. Thanks, David
4
6664
by: Jerad Rose | last post by:
I'm baffled by this -- is there not a typed object used for ComboBox Items? Best I can tell, all of the methods for ComboBox that accept an Item are of type Object. Why in the world is a common/standard .NET control accepting an Object as a parameter type? In Web Forms, there is a ListItem object that can be passed in to add/retrieve objects from a DropDownItems collection. I searched Google groups, and all the solutions I'm finding...
6
4437
by: =?Utf-8?B?UmljaGFyZCBCeXNvdXRo?= | last post by:
Hi I'm having problems getting the correct item to display in a bound combobox in my WinForms app. Using the following code: With Me.MyComboBox .ValueMember = "MyIdField" .DisplayMember = "ToString" .DataSource = MyDataTable End With
1
4246
by: Andrus | last post by:
I need to enter null value from combobox to business object property. My combobox datasource does not contain ValueMember with null value. So I tried to create combobox which stores null to bound object when text is deleted. However bound object contains old value in this case. To reproduce: 1. Run code
0
8913
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8144
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.