How to compare List<String> to DB Table using LINQ

最后都变了- 提交于 2019-12-02 04:07:48

You dont have to cast tnbrs to dataset try this instead

var custdata = from c in db.CUSTs  
               where tnbrs.Contains(c.NPA + c.NXX + c.LINE_NBR)
               select new { c.PON, c.PartnerID };

It generates sql query something like this

SELECT [t0].[PON], [t0].[PartnerID]
FROM [dbo].[CUSTs  ] AS [t0]
WHERE [t0].[NPA]) + [t0].[Nxx] + [t0].[LINE_NBR] IN (@p0, @p1)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!