使用值从一个表ID到另一个表 [英] Using Value From One table id to anothe table

查看:108
本文介绍了使用值从一个表ID到另一个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个表employee&designation,我想要获取emp id,emp名称进入指定表,我如何通过LINQ获得该值.

I have two table employee & designation I want get emp id,emp name into designation table how I can get that value through LINQ.

推荐答案

Employee-Designation有1-多的关系.
因此,Employee表将具有一个DesignationID作为外键(基本RDBMS概念).

现在,您可以使用简单的 JOIN [转换器 [
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 )


这篇关于使用值从一个表ID到另一个表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆