Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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();


I am using Telerik radgrid control and binding the radStudent to allStudents datatable.
Posted
Comments
Venkatesh Mookkan 24-Aug-10 22:34pm    
Do you get any exception?
virang_21 24-Aug-10 22:43pm    
No there is no exception generated. It is funny that it started working after one hour or so as it suppose to without any change to the code. I am using XCopy deployment. Does its previous behavior of not working properly has anything to do with that ? I am super curious now to know what exactly happening here. Any clue ?
R. Giskard Reventlov 25-Aug-10 3:34am    
Probably a dumb question but have you set up xcopy correctly? In other words, are you certain that it is copying changed files over the existing files? Perhaps some of the files are read only and you have not set the /R switch. Just a thought.

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. :)
 
Share this answer
 
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.
 
Share this answer
 
Comments
virang_21 16-Sep-10 19:18pm    
Yes I am indeed referencing to System.Data.DataSetExtensions.dll. It is in bin folder of my application and I checked the production server as well it is there too. Anyways my issue is resolved now by installing Telerik control suit on production server.

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