Select actual name value instead of Identity Seed from a (FK) column? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Select actual name value instead of Identity Seed from a (FK) column?

vinsavantvinsavant Posts: 8Member
Situation: Have two tables created in MS SQL Server 2005

[b]Table1[/b]

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

[b]Table2 [/b]

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

Comments

  • bradwangbradwang Posts: 197Member
    Set both DataValueField and DataTextField to CountryName for the dropdownlist before doing the data bind.

    Hope this will solve your problem. :)


    [color=Green][size=1][b]Brad Wang - .NET Freelancer from China
    MSN: [email protected]
    Skype: brad_wang[/b][/size][/color]
Sign In or Register to comment.