为什么此LINQ无法在生产中工作? [英] Why this LINQ is not working in production ?

查看:63
本文介绍了为什么此LINQ无法在生产中工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有两个带有studentId字段的数据表,我正在尝试使用LINQ将它们加入.该代码在开发环境中运行良好,但是在生产环境中却无法获得预期的结果.它不是在过滤我要在生产中通过LINQ过滤的数据.知道为什么吗?

Hi,
I have two datatables with studentId field and I am trying to join them using LINQ. The code is working fine in development environment but in production environment it is not giving the expected result. It is not filtering the data that I am trying to filter through LINQ in production . Any idea why ?

var selected = from s in allStudents.AsEnumerable()
                               join c in allPaymentStudentId.AsEnumerable()
                               on s.Field<string>("StudentId") equals c.Field<string>("StudentId")
                               select s;
                bool existsRecord = false;
                foreach(var sel in selected)
                {
                    existsRecord = true;
                
                }
                if (existsRecord)
                {
                    DataTable result = selected.CopyToDataTable();
                    allStudents = result;
                }

            }

            Session["AllStudents"] = allStudents;
            
            radStudent.DataSource = null;
            radStudent.Rebind();



我正在使用Telerik radgrid控件,并将radStudent绑定到allStudents数据表.



I am using Telerik radgrid control and binding the radStudent to allStudents datatable.

推荐答案

我终于找到了答案.问题出在第三方控制上.我正在使用Telerik Radgrid控件.在我的开发机器上,我安装了整套带演示的Telerik控件以及所有内容,但是在生产服务器上却没有安装.我只是将dll文件复制到应用程序的bin目录中,并引用了它们.由于我的开发机器一切正常,因此在生产服务器上并非如此.我一直在寻找google上的解决方案,并且在有人提到相同问题和解决方案的讨论之一中,是将Telerik套装安装在生产服务器上.我终于解决了这个问题. :)
I finally found the answer. The problem is with third party control. I am using Telerik Radgrid control. On my development machine I installed whole suit of Telerik controls with demo and everything but on production server I didn''t installed it. I just copied dll files in bin directory of my application and referenced them. As my dev machine has everything it was working fine but on production server it wasn''t the case. I was looking for solution on google and deep down in one of the discussion someone mentioned of the same problem and resolution is to install the Telerik suit on production server. I am finally over this problem. :)


DataSet.AsEnumerable需要System.Data.DataSetExtensions.dll.如果使用它,则还需要在生产环境中安装dll.

您确定要引用System.Data.DataSetExtensions.dll程序集吗?

请看看.
DataSet.AsEnumerable requires System.Data.DataSetExtensions.dll. If you are using it, you need to have the dll installed in production as well.

Are you sure you''re referencing the System.Data.DataSetExtensions.dll assembly?

Please take a look.


这篇关于为什么此LINQ无法在生产中工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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