how to get last row value in the datable
LINQ
5
Posts
4
Posters
29
Views
1
Watching
-
-
Could not be much simpler than using DataTable.Rows Property (System.Data) | Microsoft Docs[^].
You send the poor sod off to MS doco for "please clarify in a simple way" :laugh: :laugh: :laugh:
Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP
-
You send the poor sod off to MS doco for "please clarify in a simple way" :laugh: :laugh: :laugh:
Never underestimate the power of human stupidity - RAH I'm old. I know stuff - JSOP
-
Try the following approach: public Product GetLastProduct(DataContext dt) { return dt.Products.Last(); } this code assumes two things: 1. your database has a Product table 2. You have created LINQ to SQL and you have dragged and Dropped the Product table on to the DataContext named dt