1

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?

2

1 Answer 1

2

Try this one:

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

/* Commit it */
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.