This is a migrated thread and some comments may be shown as answers.

Inserting data into multiple tables using single RadDataForm with EntityDataSource

1 Answer 66 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
DANA REDDY
Top achievements
Rank 1
DANA REDDY asked on 28 Mar 2017, 01:01 PM

Hi,
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

 

1 Answer, 1 is accepted

Sort by
0
DANA REDDY
Top achievements
Rank 1
answered on 30 Mar 2017, 04:18 AM

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

Tags
DataForm
Asked by
DANA REDDY
Top achievements
Rank 1
Answers by
DANA REDDY
Top achievements
Rank 1
Share this question
or