Click here to Skip to main content
15,916,412 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two table employee & designation I want get emp id,emp name into designation table how I can get that value through LINQ.
Posted
Updated 20-Sep-11 2:40am
v2
Comments
Ankur\m/ 20-Sep-11 9:12am    
I moved your answer to comment below my answer. Please read my reply.

1 solution

Employee - Designation has a 1 - many relationship.
So Employee table will have a DesignationID as a foreign key (basic RDBMS concepts).

Now you can get Employee's details along with Designation details using a simple JOIN[^].

Once you have formulated the query, write it using LINQ. And if you don't LINQ, spend some time learning it (or use a converter[^] :D )
 
Share this answer
 
Comments
Ankur\m/ 20-Sep-11 9:09am    
[moved from answer]
OP wrote: Also How can i sent emp id and emp name value in designation table
Ankur\m/ 20-Sep-11 9:12am    
You don't send it. It's done when you design the tables. Google for 'Create Table SQL' and check out the foreign key part.
You need to learn the basics first before you start programming. I would suggest you to go through some tutorials on the web or read a good SQL book.

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900