0
我需要在我的select語句中獲取索引。在linq select中獲取記錄索引列
我的代碼:
IQueryable grpdRows;
dtInput = ds.Tables[0];
grpdRows = dtInput
.Select("", "partno")
.AsQueryable()
.GroupBy("new (iif(it[\"partno\"] == null, \"\", it[\"partno\"]) as GrpKey1)","it")
.Select("new (it.Key.GrpKey1 as GrpKey1, it.Count() as TotalCount")");
如何讓指數在select語句例如:
.Select("new (it.Key.GrpKey1 as GrpKey1, it.Count() as TotalCount, **it.Index**")");