![](/img/trans.png)
[英]How to retrieve data from the database to the second table after selecting the user in the first table?
[英]retrieve a second option of a table
我正在使用C#和ADO.Net實體數據模型開發應用程序。 我在SQL Server數據庫中有一個表Users,其中包含3列(idUser,nameUser,statusUser)。 檢索具有statusUser = 0的表的第二個,第三個或第N個用戶的代碼是什么?
試試這個,我們用於分頁等。
using (soforumEntities ctx = new soforumEntities())
{
Article a = ctx.Articles.Where(c => (c.ArticleStatus != null && c.ArticleStatus.HasValue && c.ArticleStatus.Value != true)).OrderBy(x => x.ArticleStatus).Skip(1).Take(1).SingleOrDefault();
Console.WriteLine(a.Id + a.Name);
}
看一下DENSE_RANK函數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.