-
February 8th, 2007, 12:56 PM
#1
How can I retrieve Current Relational Data from DataSet
I have two tables
tblEntity [ Entity ID , Entity Name ,........]
tblUser [ UserID , Entity ID , UserName , ............]
I have created DataRelation "entityVuser" in between these two tables and successfully added in DataSet. I have two comboboxes one is showing Entity Names and when i select an entity the second combobox shows its related Users through “entityVuser" relation.
Can I retrieve such users from dataSet directly? Let’s suppose I have a function
comboBox_EntityNames_SelectionChangeCommitted( ....... )
Q1.when i select an entity from EntityNames combobox this function will be fired and i want to get list of all users related to selected entity.
Is it possible?
I m curious about the architecture of ComboBox ( DisplayMember and ValueMember)
for example
Code:
comboBox_UserLastName.DataSource = m_ds;
comboBox_UserLastName.DisplayMember = "Entity.entityVuser.UserLastName";
comboBox_UserLastName.ValueMember = "Entity.entityVuser.UserId";
How Combobox retrieve such relational values from data set.
Is there any way like, I get child table data directly from dataset?
m_ds.Tables["Entity.entityVuser"].Columns["UserLastName"]
Last edited by Naumaan; February 8th, 2007 at 01:51 PM.
A Person who is polite is given goodness and a person who is away from Politeness is away from Goodness.
NAUMAAN
-
February 9th, 2007, 03:22 AM
#2
Re: How can I retrieve Current Relational Data from DataSet
You would use the GetChildRows method of the selected parent DataRow.
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
|