我已經使用ADO.NET實體框架將一些記錄存儲到數據庫中。我想知道在C#.Net中使用ADO.NET Entity Framework的特定表中的總記錄數。
我舉了一些例子,但它不工作。ADO.NET DataService記錄數量
EX:
DataServiceQuery<BunHistory> query= context.BunHistory.IncludeTotalCount();
QueryOperationResponse<BunHistory> response
query.Execute() as QueryOperationResponse<BunHistory>;
long count = response.TotalCount;
當我運行此代碼時,我收到了一些異常「處理此請求時發生錯誤。」喜歡這個。
感謝
可能的複製http://stackoverflow.com/questions/647425/how-to-do-select-count-on-ado-net-entity-framework – 2010-05-17 04:36:39