CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2001
    Location
    Pretoria, Gauteng
    Posts
    46

    'Join' like behavior in a BindingSource with the Filter property?

    Hi all,

    following on from my previous post (and hence using the same table structure) I'm trying to limit the items in the combo box to those already used in the relationship. In other words, if the relation Parent_ChildId joins tables Parent and Child on the ChildId columns in each table I want to be able to make only those entries in Child available that have already been joined with Parent. I can't use a traditional join into a temporary table or anything like that because the DataSet isn't connected to a database, it exists only in the application and is saved to/loaded from XML files.

    I have been trying to do this with the Filter property on a BindingSource bound to the Child table, since this seems to have pretty powerful expression evaluation capabilities but I'm just not having any luck with this particular task. Has anyone achieved this before, could you give some pointers?



    Thanks

  2. #2
    Join Date
    Jun 2001
    Location
    Pretoria, Gauteng
    Posts
    46

    Re: 'Join' like behavior in a BindingSource with the Filter property?

    For reference, I have made some progress with this, though I'm not quite there yet.
    The Expression interpreter understands the 'IN' keyword, and when a relation is being used, the 'Child' and 'Parent' keywords are valid, so Parent(Parent_ChildId1).ChildId1 returns the set of values in the ChildId1 column used in the Parent_ChildId1 relation.

    Infortunately 'IN' expects a constant set, so the following code results in an error at runtime:
    Code:
    filteredChildBindingSource->Filter = L"ChildId IN (Parent(Parent_ChildId1).ChildId1)";
    So close, yet so far

  3. #3
    Join Date
    Jun 2009
    Posts
    1

    Question Re: 'Join' like behavior in a BindingSource with the Filter property?

    Hello, I was trying to do the same in vb.net. Can you let me know how to set the
    filter for a child form using the LINQ databindingsource.

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