I have three tables
first table: vendors consists of the following columns:
vendor id (unique), address_id , specialty_id (address_id and specialty_id columns compose a unique key)
Second table: Addresses consists of the following columns:
address id (unique/key) - relationship to vendor table,
Addr_Name, addr1, addr1, city, state, zip
Third table: Specialty consists of the following columns:
Specialty id (unique/key) - relationship to vendor table
Specialty_desc
Concept is that I can have an address_id listed in the vendor table more than once with a different specialty_id.
IE: a vendor can have more than one specialty.
I want to create a lookup/edit form that displays the address name, addr1, addr2, city, state, zip and specialty description.
I want to build a dataset table that is limited to certain specialty type and display them in the lookup/edit form.
I would like the form to contain a combo box that displays all the vendor names from the dataset table.
The problem I am running into is the one dealing with the specialty description - I seem to be creating a list that holds the vendor name multiple times - once for each specialty. I would like the vendor name to appear only once. And I would like a datagrid/list of all the specialty descriptions associated with that vendor to display.
And I want to be able to add more specialties to an existing vendor.
I know that this is complicated. But, because I don't know vb .net and its ado interface well enough - I am spinning my wheels trying to move to the next step. An outline of the steps needed to set it up would be appreciated.
My current outline is:
initialization:
in dataset vendor_addresses
fill vendors
fill addresses
fill specialty
build vendor_specialty table in dataset vendor_addresses
'filter vendor for specified specialties and build table
'of addresses, specialties, and vendor_id
end initialization
Load form:
select all address names from dataset vendor_addresses
using a datareader
load into vendor name combobox.
end datareader process
bind the textboxes to the vendor_addresses table
???
end Load
The ??? is where I am stuck. How do I handle the specialty_description? Currently I have an entry in the vendor_address table for each vendor/specialty combination so a vendor name appears several times - but this won't be helpful to the end-user. I want the vendor name to appear only once in the combo-box. So, should I be adding an additional filter to build the combo-box to display the vendor's name? And how do I show the specialties associated with the vendor name? A list box? a datagrid? and how/where does one fill it in the logic? Do I need to add more adapters/olecommands/sqlcommands and connections? or views? None of my books (of which I have six) is giving me much help with this real world situation.
first table: vendors consists of the following columns:
vendor id (unique), address_id , specialty_id (address_id and specialty_id columns compose a unique key)
Second table: Addresses consists of the following columns:
address id (unique/key) - relationship to vendor table,
Addr_Name, addr1, addr1, city, state, zip
Third table: Specialty consists of the following columns:
Specialty id (unique/key) - relationship to vendor table
Specialty_desc
Concept is that I can have an address_id listed in the vendor table more than once with a different specialty_id.
IE: a vendor can have more than one specialty.
I want to create a lookup/edit form that displays the address name, addr1, addr2, city, state, zip and specialty description.
I want to build a dataset table that is limited to certain specialty type and display them in the lookup/edit form.
I would like the form to contain a combo box that displays all the vendor names from the dataset table.
The problem I am running into is the one dealing with the specialty description - I seem to be creating a list that holds the vendor name multiple times - once for each specialty. I would like the vendor name to appear only once. And I would like a datagrid/list of all the specialty descriptions associated with that vendor to display.
And I want to be able to add more specialties to an existing vendor.
I know that this is complicated. But, because I don't know vb .net and its ado interface well enough - I am spinning my wheels trying to move to the next step. An outline of the steps needed to set it up would be appreciated.
My current outline is:
initialization:
in dataset vendor_addresses
fill vendors
fill addresses
fill specialty
build vendor_specialty table in dataset vendor_addresses
'filter vendor for specified specialties and build table
'of addresses, specialties, and vendor_id
end initialization
Load form:
select all address names from dataset vendor_addresses
using a datareader
load into vendor name combobox.
end datareader process
bind the textboxes to the vendor_addresses table
???
end Load
The ??? is where I am stuck. How do I handle the specialty_description? Currently I have an entry in the vendor_address table for each vendor/specialty combination so a vendor name appears several times - but this won't be helpful to the end-user. I want the vendor name to appear only once in the combo-box. So, should I be adding an additional filter to build the combo-box to display the vendor's name? And how do I show the specialties associated with the vendor name? A list box? a datagrid? and how/where does one fill it in the logic? Do I need to add more adapters/olecommands/sqlcommands and connections? or views? None of my books (of which I have six) is giving me much help with this real world situation.