Dhaval Marthak
Dhaval Marthak

Reputation: 17366

Insert into multiple tables using ado.net entity object

I want to insert records in multiple tables with entity framework 4.0

My database contains 2 tables

 1. Student (StudentID - PrimaryKey)
 2. Standard (StudentID - ForeignKey)

How can I add values into these table at one time?

Upvotes: 1

Views: 587

Answers (1)

MikroDel
MikroDel

Reputation: 6735

Try this one:

Student student = new Student();
...
Standard standard = new Standard();
standard.Student = student;

/* Commit it */

Upvotes: 2

Related Questions