2 mutually exclusive listboxes - in vb.net with dataviews HELP

G

Guest

Can and how do you alter a data view to include a look up field from another
data table? The data table of the dataview only has the key, the value I need
is in another data table.

Can and how to you reference the value of a column in a data table/view from
the row filter string of a different data view.

I'm using a strongly typed dataset.

Below is more info.
ok...
I'm trying to create 2 mutually exclusive listboxes in vb.net using
dataview(s) of a strongly typed dataset. I dragged two tables onto the XSD
file and created the relationship. DeviceSoftware.SoftwareID =
Software.SoftwareID The 2 data tables are populated by 2 stored procedures.

I have 2 data tables, DeviceSoftware and Software.
DeviceSoftware is a child that holds the DeviceID's and their software
(SoftwareIDs)

Software is the parent but is more like a look up of distinct software
titles.

ListBox1 items should show Software Titles that are installed on a paticular
Device (deviceID). How do I bind ListBox1 to the DeviceSoftware data table or
a data view when actual Software names are held in the Software table. I am
setting the Datasource for the ListBox to the data view, except the dataview
only has the SoftwareID field not the SoftwareName Field.

ListBox2 items should show all the OTHER Software Titles not installed on
the device. I have the same binding problems except, I need the row filter to
exlcude
Software Names that are already installed on the device.

I want to be able to drag and drop items back and forth between Listbox1 and
Listbox2 (that is a whole nother issue).
 
W

W.G. Ryan eMVP

If I understand you correctly, just make sure you create new DataViews. If
you use the new Keyword then you can you reference the same table and they
will behave independently.

DataView bindingView1 = new DataView(TableName);
DataView bindingView2 = new DataView(TableName);//same table for each

Then you can bind the listboxes and change the rowfilters or whatever and
they will behave independently
 
G

Guest

hmm, not re-ask the question

I have the following schema for the two tables

dataset1.datatable1 schema
deviceID
softwareID

dataset2.datatable2 schema
softwareID
softwareName
softwareDesc

Listbox1 is bound to datatable1 but needs to show softwareName, so listbox1
only shows the softwareID, I need it to do a lookup on datatable2 to get the
softwareName

If I bound Listbox1 to datatable2 instead, I still have a problem with how
do I only show softwareName records that are assigned to datatable1

I can use dataviews to filter, but what will the dataview.rowfilter() look
like???
 
G

Guest

all the examples I see only show 1 dataview to 1 table relationship. Are you
saying use 1 view to 2 datatables or 1 view to 2 subviews?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top