Select actual names from a dropdown list from SQL in Visual Studio.net?

mmunoz

New member
Joined
Aug 23, 2008
Messages
3
Programming Experience
Beginner
Situation:

Have two tables created in MS SQL Server 2005

Table1

CustomerID Integer PK
CustomerName Varchar
CustomerAddress Varchar
CountryID FK (from Country Table)

Table2

CountryID Integer PK
CountryName Varchar
CountryRegion FK (from Region Table)

Current Outcome:

I connected Table1 (this table was already populated with a few sample records) to Visual Studio.Net 2008 and placed this tables TextBoxControls on a Form for the purpose of DataEntry of new records and/or modification of existing records on the table. This part works as intended. I converted the CountryID field into a DropDownList in order to pick the appropriate country depending on the customer. This part is the problem. First of all, it only show one record available in this field, the seed value of the CountryID from the Table2 CountryID (example 1).

Desired Outcome

What I need this field to do is to show me a list of “actual country names” available from the Table2 CountryName field not their value seed.

Please provide me as much detail in your answer as possible. I have some basic understanding of relational databases which will allow me to follow your instructions if you structure in a step by step format.

Thank you so much for your help!
 

Latest posts

Back
Top