Results 1 to 2 of 2

Thread: Can Bindings be added Going From Child table to Parent?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2020
    Posts
    12

    Can Bindings be added Going From Child table to Parent?

    I have 3 tables in my dataset with bindings to textboxes that work great. I want to add another table and set additional bindings with textboxes, but I am not sure if it is possible. I have added a LINQ query that grabs the data needed, but I would prefer using another binding source. I would like to know if adding additional bindings for textboxes for another table is possible and how to go about it.

    The 3 tables that I do not have any problems with are related.
    The parent table is "Contracts", and it has a "ContId" field as the PK.
    The code is:
    Code:
     
                //Contracts Binding
                bsContracts = new BindingSource();
                bsContracts.DataSource = dsPlanning;            //DataSet
                bsContracts.DataMember = contracts.TableName;   //DataTable
    I have a child table called "Link_Contract_Letting" and it has 2 FKs "ContId" and "LetId"
    The code is:
    Code:
                //Links Binding
                bsLinks = new BindingSource();
                bsLinks.DataSource = bsContracts;    //Master binding source bsLettings
                bsLinks.DataMember = "ContToLink";   //"ContToLink" is the data relationship between the Contracts and Link tables.
    I have a second child table called "Deses" and it has 1 FK "ContId"
    The code is:
    Code:
                //Deses Binding
                bsDeses = new BindingSource();      //Deses has a Details relationship to Contracts as in Master to Details. Therefore this binding is different.
                bsDeses.DataSource = bsContracts;   //Master binding source bsContracts
                bsDeses.DataMember = "ContToDes";   //"ContToDes" is the data relationship between the Contracts and Deses tables.
    In addition I have 2 binding navigators and the code is:
    Code:
                //Bind to Binding Navigator
                bnContracts.BindingSource = bsContracts;
                bnDeses.BindingSource = bsDeses;

    I want to add a parent table to the "Link_Contract_Letting" table called "Lettings" and it would be related to the "Link_Contract_Letting" table through a PK called "LetId".

    I have tried several ways to bind the additional table and I get an error stating "Cannot bind to the property or column 'Letting_Date' on the DataSource."

  2. #2

    Thread Starter
    New Member
    Join Date
    Apr 2020
    Posts
    12

    Re: Can Bindings be added Going From Child table to Parent?

    Hello, I am a little confused. I have posted here before, at least on the vb.net side, and I have always gotten a reply within hours. There has been several people that have looked at my question over the weekend, but I have not gotten any responses. Is there something I am asking that is not clear? Did I say something wrong? I seem to understand bindings for the 3 tables that are working but adding the forth table I am not sure if it is possible or if there is something that I just do not get. I would really like to get some guidance if that is possible. Please help. Thank you.

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