|
-
February 2nd, 2006, 07:43 AM
#2
Re: How to assign columns of two diferent tables to "valuemember" and "displaymember" pro
You can't do that. This is one of the biggest pains in ADO.NET - you can't have a "Joined View" of two tables with a relation between them.
I can offer two solutions:
1. If you are connected to a database, use a Command object to retrieve a table with a JOIN SQL statement. This will solve most of your problems - you can het all the columns you need from both tables.
2. You can use JoinView, and use it as a datasource. The code and examples is here:
http://support.microsoft.com/kb/325682/EN-US/
And an article about it is here: Using JoinView to Show Queries From Multiple Tables
One other advice I can give if none of these suit your needs: Refactor your design. Simply put: Think of another way to do it.
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
|