473,382 Members | 1,775 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.

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 1948
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**@fairlesshouse.freeserve.co.uk> wrote in message
news:cc**********@newsg4.svr.pol.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.com> wrote in message
news:uF*************@TK2MSFTNGP11.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**@fairlesshouse.freeserve.co.uk> wrote in message
news:cc**********@newsg4.svr.pol.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**@fairlesshouse.freeserve.co.uk> wrote in message
news:cc**********@news7.svr.pol.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.com> wrote in message
news:uF*************@TK2MSFTNGP11.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**@fairlesshouse.freeserve.co.uk> wrote in message
news:cc**********@newsg4.svr.pol.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
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,...
2
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
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...
3
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...
0
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...
8
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...
4
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...
6
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 =...
1
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.