Ask the basic issues of LINQ!

The SQL statement is such

****
from HD201311 where CallType=2 and Len(Called)>5 and TotalLen>0
group by Ent_id,SDate

I'm taking data, in a recordset, operation, where condition after the report was wrong
 var query_Trs_Suc = from data in ds.Tables[0].AsEnumerable()
                                where data.Field<int>("CallType") == 2 && data.Field<string>("Called").Length > 5 &&  data.Field<int>("TotalLen")>0   //This local pass. . 
                                group data by new { t1 = data.Field<string>("Ent_ID"), t2 = data.Field<string>("SDate") } into m
                                select new
                                {
                                    _Ent_ID = m.Key.t1,
                                    _SDate = m.Key.t2,
                                    _CallIn_TRS_Suc = m.Count()
                                };


data.Field<int>("TotalLen")>This is not the same as SQL 0 was tested in 0 TotalLen> error. .

Started by Mike at November 26, 2016 - 10:53 PM

Report any fault.?

Posted by Quentina at December 11, 2016 - 11:50 PM

Should be the problem of data

You have a look in your ds.Tables[0] data, is it right? And the emergence of NULL.

According to several fields to use in your code

Posted by Malcolm at December 27, 2016 - 12:28 AM

You this LINQ code is used to query dataset
Is it doesn't matter and SQL, the query is memory data

Posted by Malcolm at January 10, 2017 - 1:04 AM