在实体框架中的两个表之间进行选择
我想在两个有关系的表之间编写一个选择。 我使用这段代码,但没有得到任何结果。 请告诉我
using (doctorEntities de = new doctorEntities())
{
var select = from tibase in de.Table_infobase_print
from tidetail in de.Table_infodetail_print
where tibase.ID == tidetail.ID_infobase
select new
{
tidetail.services_discription,tidetail.price,tibase.folder_code
};
}
I want to write a select between two table that have relation.
I use this code but i get no result.
Please advise me
using (doctorEntities de = new doctorEntities())
{
var select = from tibase in de.Table_infobase_print
from tidetail in de.Table_infodetail_print
where tibase.ID == tidetail.ID_infobase
select new
{
tidetail.services_discription,tidetail.price,tibase.folder_code
};
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可能正在寻找联接,无论数据库中是否有匹配的行,您都应该获得结果。目前您还没有对结果做任何事情。
I think you might be looking for a join instead, regardless you should be getting results if you have matching rows in the database. Also currently you are not doing anything with the results.