SELECT Max(VarInvoiceNo) FROM tbl_feesCollection
Asked
Active
Viewed 630 times
-2
Rahul Tripathi
- 161,154
- 30
- 262
- 319
LEO221
- 3
- 4
-
1Possible duplicate of [Using Linq to SQL, how do I find min and max of a column in a table?](http://stackoverflow.com/questions/2268175/using-linq-to-sql-how-do-i-find-min-and-max-of-a-column-in-a-table) – Devraj Gadhavi May 18 '16 at 07:07
1 Answers
2
Use the Max() method:
var result = db.tbl_feesCollection.Max(element => element.VarInvoiceNo);
René Vogt
- 41,709
- 14
- 73
- 93
-
var result = db.tbl_feesCollections.Max(element => element.VarInvoiceNo); it's worked – LEO221 May 18 '16 at 14:24
-
@LEO221 did not know how you called your datacontext instance, updated my answer to match your `db`. – René Vogt May 18 '16 at 14:25