Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#4.0 Framework entity
I have four tables Employee_Details,Employee_Contact_Details,Department_Wise_Employee and Skill_Wise_Employee.
 
I have to make one model from four different table entities.
So i have to write only one CRUD operation due to which all fours table get updated.
Posted 29-Aug-12 1:09am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You can create a 'View' of all the 4 tables which will have selected fields from your 4 tables Employee_Details,Employee_Contact_Details,Department_Wise_Employee and Skill_Wise_Employee.Now create an entity model of your 'View' according to your attributes present in 'View'.For 'View' refer to following sites.
 
http://odetocode.com/articles/299.aspx[^]
 
http://www.w3resource.com/sql/creating-views/create-view-with-join.php[^]
 
You can write LINQ queries taking into account your entity model class corresponding to created View.Make sure that the View name in database should be same with your model entity class name.Then you can carry out CRUD operations as like as in normal entity models.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Quote:
You have to maintain relationship between all the four table's.
Then you have to add a ADO.NET Entity Framework in your project.
select all the required table's from your database.
 
And the last one is to use LINQ to SQL query for writing CURD query's
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 250
1 George Jonsson 175
2 Jochen Arndt 150
3 Kornfeld Eliyahu Peter 149
4 PIEBALDconsult 110
0 OriginalGriff 6,080
1 DamithSL 4,648
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,624
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 2 Aug 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100