如何将实体框架的查询转换为数据表? [英] How can I convert a query of entity framework to a datatable?

查看:103
本文介绍了如何将实体框架的查询转换为数据表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了使用Crystal Reports,我需要将实体框架的查询转换为数据表.似乎CR不允许使用可为空的数据类型,因此任何无法为空的EF属性都无法在报表中显示,这无法满足我们的需求.因此,我们需要返回将数据表作为数据源传递给Crystal Report.

I need to convert a query of entity framework to a datatable in order to use Crystal Reports. Seems that CR doesn''t allow nullable datatypes, therefore any nullable EF properties cannot be shown on the Report which doesn''t work for our needs. So, we need to go back to passing in a datatable as the DataSource to the Crystal Report.

推荐答案

尝试此链接,它将帮助您生成输出.您正在寻找.

http://www.c-sharpcorner.com/UploadFile/VIMAL.LAKHERA/LINQResultsetToDatatable06242008042629AM/LINQResultsetToDatatable.aspx [ ^ ]

希望这对您有帮助!
try this link , it will help you out to generate your output you are looking for.

http://www.c-sharpcorner.com/UploadFile/VIMAL.LAKHERA/LINQResultsetToDatatable06242008042629AM/LINQResultsetToDatatable.aspx[^]

Hope this will help !!!


检查此技巧,并使其完全符合您的要求.

"http://www.codeproject.com/Tips/171006/Convert-LINQ-to-Entity-Result-to-a-DataTable.aspx"
Check this tip and trick it does exactly what you want.

"http://www.codeproject.com/Tips/171006/Convert-LINQ-to-Entity-Result-to-a-DataTable.aspx"


这篇关于如何将实体框架的查询转换为数据表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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