virang_21 0 Light Poster

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.