Inserting data into multiple tables using single RadDataForm with EntityDataSource

2 posts, 0 answers
    DANA REDDY avatar
    2 posts
    Member since:
    Mar 2017

    Posted 28 Mar 2017 Link to this post

    I have a scenario where in I have to insert data into multiple tables using a single RadDataForm with EntityDataSource

    Following are the three tables and Columns
    ComType:  Id, ConType

    ContactDetail:  Id, ContactName, City

    ContactCom: Id, ContactDetailsId, ComTypeId, ComValue

    The point is I am able to insert into single table but not able to insert into multiple tables.

    <asp:Label ID="ComValueLabel3" runat="server" AssociatedControlID="ComValueTextBox" CssClass="rdfLabel rdfBlock" Text="ComValue"></asp:Label>
      <telerik:RadTextBox ID="ComValueTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("ComValue") %>' WrapperCssClass="rdfInput" />


    Following is the syntax of calling other tables columns while insertion
    <asp:Label ID="ContactNameLabel2" runat="server" AssociatedControlID="ContactNameTextBox" CssClass="rdfLabel rdfBlock" Text="ContactName"></asp:Label>
     <telerik:RadTextBox ID="ContactNameTextBox" runat="server" RenderMode="Lightweight" Text='<%# Bind("ContactDetail.ContactName") %>' WrapperCssClass="rdfInput" />

    EntityDataSource Code:
    <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=sampleEntities" DefaultContainerName="sampleEntities" EnableDelete="True" EnableFlattening="False" EnableInsert="True" EnableUpdate="True"
    EntitySetName="ContactComs" EntityTypeFilter="ContactCom" Include="ContactDetail,ComType"></asp:EntityDataSource>

    I am unable to call the columns of other tables which are in include method

    Here I am attaching the sample DB and full code of my scenario

    How can I accomplish this

    Thanks In Advance


    DANA REDDY avatar
    2 posts
    Member since:
    Mar 2017

    Posted 29 Mar 2017 Link to this post

    Please any one help me on my scenario. It might be simple but i could not do it and its very urgent.

    Thanks in advance

Back to Top