I'm attempting to bind a combobox to store the values in
tblProblems.VersionID and display the Version value from the tblVersions.
The VersionID field is a foreign key to the ID in tblVersions. Currently I
have the combobox displaying the versions in the dropdown which is what I
need but when I select a different version it is displayed for every record
(apparently not bound to the value of VersionID in tblProblems.
Documentation that I have is confusing and doesn't really address my
situation of using the validation table. I routinely use this technique in
Microsoft Access but the control binds very differently.
TABLES
--------------
tblProblems.VersionID (1)
tblVersions.ID (1)
tblVersions.Version (1.0.1)
RELATIONSHIPS
-------------
ProblemsVersionIDColumn = DataSet11.Tables("tblProblems").Columns("VersionID ")
VersionsKeyColumn = DataSet11.Tables("tblVersions").Columns("ID")
problemsversions = New DataRelation("problemsversions",
ProblemsVersionIDColumn, VersionsKeyColumn)
DataSet11.Relations.Add(problemsversions)
COMBOBOX PROPERTIES
---------------------
DataSource tblVersions
DisplayMember - Version
ValueMember - ID
DataBindings.SelectedItem (None)
DataBindings.SelectedValue (None)
DataBindings.Text (DataSet11 - tblProblems.VersionID)
--
Steve King 3 1368
Steve,
And what do you need?
Cor
"Steve King" <St*******@discussions.microsoft.com> schreef in bericht
news:C4**********************************@microsof t.com... I'm attempting to bind a combobox to store the values in tblProblems.VersionID and display the Version value from the tblVersions. The VersionID field is a foreign key to the ID in tblVersions. Currently I have the combobox displaying the versions in the dropdown which is what I need but when I select a different version it is displayed for every record (apparently not bound to the value of VersionID in tblProblems.
Documentation that I have is confusing and doesn't really address my situation of using the validation table. I routinely use this technique in Microsoft Access but the control binds very differently.
TABLES -------------- tblProblems.VersionID (1)
tblVersions.ID (1) tblVersions.Version (1.0.1)
RELATIONSHIPS ------------- ProblemsVersionIDColumn = DataSet11.Tables("tblProblems").Columns("VersionID ") VersionsKeyColumn = DataSet11.Tables("tblVersions").Columns("ID") problemsversions = New DataRelation("problemsversions", ProblemsVersionIDColumn, VersionsKeyColumn) DataSet11.Relations.Add(problemsversions)
COMBOBOX PROPERTIES --------------------- DataSource tblVersions DisplayMember - Version ValueMember - ID
DataBindings.SelectedItem (None) DataBindings.SelectedValue (None) DataBindings.Text (DataSet11 - tblProblems.VersionID) -- Steve King
when I select a different version it is displayed for every record
(apparently not bound to the value of VersionID in tblProblems.
When I move the form from record to record I expected the relationship to
cause the combobox to display the version number related to the record being
viewd, and it doesn't.
tblProblems.VersionID -> FORM (COMBO) <-- tblVersions.ID (Value),
tblVersions.Version (Display)
--
Steve King
"Cor Ligthert [MVP]" wrote: Steve,
And what do you need?
Cor
"Steve King" <St*******@discussions.microsoft.com> schreef in bericht news:C4**********************************@microsof t.com... I'm attempting to bind a combobox to store the values in tblProblems.VersionID and display the Version value from the tblVersions. The VersionID field is a foreign key to the ID in tblVersions. Currently I have the combobox displaying the versions in the dropdown which is what I need but when I select a different version it is displayed for every record (apparently not bound to the value of VersionID in tblProblems.
Documentation that I have is confusing and doesn't really address my situation of using the validation table. I routinely use this technique in Microsoft Access but the control binds very differently.
TABLES -------------- tblProblems.VersionID (1)
tblVersions.ID (1) tblVersions.Version (1.0.1)
RELATIONSHIPS ------------- ProblemsVersionIDColumn = DataSet11.Tables("tblProblems").Columns("VersionID ") VersionsKeyColumn = DataSet11.Tables("tblVersions").Columns("ID") problemsversions = New DataRelation("problemsversions", ProblemsVersionIDColumn, VersionsKeyColumn) DataSet11.Relations.Add(problemsversions)
COMBOBOX PROPERTIES --------------------- DataSource tblVersions DisplayMember - Version ValueMember - ID
DataBindings.SelectedItem (None) DataBindings.SelectedValue (None) DataBindings.Text (DataSet11 - tblProblems.VersionID) -- Steve King
Steve,
I thought that this is the part where I never could use the relations.
Can you try this sample. http://www.vb-tips.com/default.aspx?...1-af26354b1fa0
This is three deep and using a datagrid, however that is in my opinion a
detail.
Cor
"Steve King" <St*******@discussions.microsoft.com> schreef in bericht
news:88**********************************@microsof t.com... when I select a different version it is displayed for every record (apparently not bound to the value of VersionID in tblProblems.
When I move the form from record to record I expected the relationship to cause the combobox to display the version number related to the record being viewd, and it doesn't.
tblProblems.VersionID -> FORM (COMBO) <-- tblVersions.ID (Value), tblVersions.Version (Display)
-- Steve King
"Cor Ligthert [MVP]" wrote:
Steve,
And what do you need?
Cor
"Steve King" <St*******@discussions.microsoft.com> schreef in bericht news:C4**********************************@microsof t.com... > I'm attempting to bind a combobox to store the values in > tblProblems.VersionID and display the Version value from the > tblVersions. > The VersionID field is a foreign key to the ID in tblVersions. > Currently > I > have the combobox displaying the versions in the dropdown which is what > I > need but when I select a different version it is displayed for every > record > (apparently not bound to the value of VersionID in tblProblems. > > Documentation that I have is confusing and doesn't really address my > situation of using the validation table. I routinely use this > technique > in > Microsoft Access but the control binds very differently. > > TABLES > -------------- > tblProblems.VersionID (1) > > tblVersions.ID (1) > tblVersions.Version (1.0.1) > > RELATIONSHIPS > ------------- > ProblemsVersionIDColumn = > DataSet11.Tables("tblProblems").Columns("VersionID ") > VersionsKeyColumn = DataSet11.Tables("tblVersions").Columns("ID") > problemsversions = New DataRelation("problemsversions", > ProblemsVersionIDColumn, VersionsKeyColumn) > DataSet11.Relations.Add(problemsversions) > > COMBOBOX PROPERTIES > --------------------- > DataSource tblVersions > DisplayMember - Version > ValueMember - ID > > DataBindings.SelectedItem (None) > DataBindings.SelectedValue (None) > DataBindings.Text (DataSet11 - tblProblems.VersionID) > -- > Steve King This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Omar |
last post by:
When I try to databind my comboBox (specifically field "emplcode") to a
filled dataset , the contents of the comboBox displays a bunch of
"System.Data.DataRowView". I assume the amount of times...
|
by: Bruce |
last post by:
Hi, there,
I meet a problem about comboBox binding.
--------------------
Database: Northwind
Tables: 1) Products 2) Categories
I create a form (named "form1") to edit the record from...
|
by: Michael C# |
last post by:
I'm binding a Combobox to an Arraylist, and I'd like to set the ValueMember
and DisplayMember properties of the Combobox. Is this possible, or do I
need to bind to a DataTable?
Thanks
|
by: JSantora |
last post by:
Essentially, InsertAT is broken!
For the past couple of hours, I've been getting this "Parameter name:
'-2147483550' is not a valid value for 'index'." error.
Apparently, its caused by having...
|
by: Jim Shaffer |
last post by:
Perhaps I have the wrong construct, or misunderstand arrays in vb (2003)....
I've loaded a two-dimensional array (168 by 28) into memory as AcctArray.
{Dim AcctArray (500,28) as string...}
The...
|
by: amber |
last post by:
Hello,
I have 6 comboboxes, that I thought I could bind to the same datasource, and
have them display different 'selectedvalue's', but apparently I can't...
My code is as follows:
dim drv as...
|
by: oracle |
last post by:
Greetings,
I have a combo box that I binded to a data set using text and tags. I
want it to display the DRT.Name property and have a DRT.UnitId as a
value.
...
|
by: Simon Tamman |
last post by:
I've come across an interesting bug.
I have workarounds but i'd like to know the root of the problem. I've
stripped it down into a short file and hope someone might have an idea about
what's going...
|
by: =?Utf-8?B?Sm9obiBCdW5keQ==?= |
last post by:
New to databinding in vs2005, I always did it manually in 2003. I have no
problem loading comboboxes, and a change in that combobox changes the data in
the textboxes but I can not figure out a way...
|
by: Monty M. |
last post by:
Does anyone know how to perform two way data binding between a combo
box and a listview.
The listview is bound to a dataset table in code:
Binding Bind = new Binding();
DataTable dt;...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
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,...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |