开发者

linq to sql joining two table

开发者 https://www.devze.com 2023-01-10 18:55 出处:网络
how can i do a开发者_如何学编程 join in this query to another table dynamic list = _db.Users.Where(m => m.vcr_UserName != \"superadmin\").OrderByDescending(m => m.int_UserId).ToPagedList(Cpag

how can i do a开发者_如何学编程 join in this query to another table

 dynamic list = _db.Users.Where(m => m.vcr_UserName != "superadmin"  ).OrderByDescending(m => m.int_UserId).ToPagedList(Cpage, defaultPageSize);

i must have a topagedList there


You can use Join(). The tricky part is you must get the keys to be joined on from both tables into the same type to be compared, anonymous types are particularly useful for this.

Signatures are here: http://www.hookedonlinq.com/JoinOperator.ashx

You can find lots of examples (in the more magical from... form) here: http://msdn.microsoft.com/en-us/vbasic/bb688085.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消