I have a problem
I have a table with 44839 records
But when I try to load my table through EF with this code:
dbContext = new MyDbContext("MyContext");
dbContext.SalesRegister.Load();
BindingList<SalesRegister> db =dbContext.SalesRegister.Local.ToBindingList();
gridControl.DataSource = db;
bsiRecordsCount.Caption = "RECORDS : " + db.Count;
I only get 16311 records
But when I use this I get all my records
dbContext = new MyDbContext("MyContext");
List<SaleRegister> db = dbContext.SalesRegister.SqlQuery("select * from vwSalesRegister").ToList();
gridControl.DataSource = db;
bsiRecordsCount.Caption = "RECORDS : " + db.Count;
Why is this happening??
And the solution for this was really simple!! Make sure to define the PK on both sides (code & database). Thanks to @IvanStoev
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With