|
-
Jan 16th, 2012, 03:48 PM
#1
Thread Starter
Addicted Member
[RESOLVED] Combobox and Parent columns
I am using the following code which populates a combobox with Location Codes from a table called tb_StoreLocations.
Dim SQLStr As String
Dim dtTableData As New DataTable
Dim dbDataAdapter As SqlDataAdapter
SQLStr = ("Select Locationcode from tb_StoreLocations where StoreCode = '" & storekey & "'")
dbDataAdapter = New SqlDataAdapter(SQLStr, PubConnString)
dbDataAdapter.Fill(dtTableData)
ComboBox4.DataSource = dtTableData
What I would like to do is instead of displaying location Codes use another table called tb_locations to display the location names.
tb_locations consists of
ID
LocationCode
LocationName
I have created a relationship between these 2 tables with Locations being the parent but I don't know how to fill the combobox with the parent locationname rather than the locationcode
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|