SELECT Max(VarInvoiceNo) FROM tbl_feesCollection
Asked
Active
Viewed 831 times
-2

Rahul Tripathi
- 168,305
- 31
- 280
- 331

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
- 43,056
- 14
- 77
- 99
-
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