English 中文(简体)
• 如何将各种id插入林克-----sql格里线
原标题:how to insert an array of id s into linq-to-sql query line in .net mvc 3

i 想要获得一系列的贴现,如<代码>[15”、“26”、“37”、“48”、“90”,并且希望从我剩余的表格中获取我的剩余物品,其中不包括这些供应商。

在此,我迄今为止做了以下工作:

string[] arrgroupdetails;
arrgroupdetails = dataContext.GroupDetails.Select(c => c.supplier_id).ToArray();

var items = from thingies in dataContext.remainings where thingies.supplier_id.ToString() != arrgroupdetails.Any().ToString() select thingies;

那么,怎样才能做到这一点?

最佳回答

从心中看,这确实是为了控制yn子,但像那那样做:

var items = from thingies in dataContext.remainings 
where !arrgroupdetails.Contains(thingies.supplier_id.ToString())
select thingies;
问题回答

暂无回答




相关问题
LINQ to SQL as databinding source for WPF Treeview

I wonder if someone could provide a simple example of the following. (preferably in VB.Net): I have an SQL database with related tables and I am successfully using LINQ to SQL in other areas of my ...

Linq to SQL insert/select foreign/primary records

I have table A and Table B. Table B contains two columns, Name and ID. Table A contains several columns and a foreign key column pointing to B.ID called B_ID On the client side, I have all the data I ...

LINQ to SQL Dynamic Sort question

How do I code the Select clause in my LINQ satament to select column aliases so I can sort on them basically I want to accomplish this SQL statement in LINQ: select type_id as id, ...

Using a schema other than dbo in LinqToSql Designer

Is there a way to specify in a data connection or the LinqToSql Designer a schema? Whenever I go to setup a data connection for LinqToSql there doesn t seem to be anyway to specify a schema and I ...

热门标签