CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Dec 2002
    Location
    St.Louis MO, USA
    Posts
    672

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured