Category:Nintendo DS games
Category:Nintendo DS-only games
Category:Kadokawa Dwango franchises
Category:Role-playing video games
Category:Tactical role-playing video games
Category:TMS Entertainment games
Category:Japan-exclusive video games
Category:Video games developed in Japan
Category:Video games set in Russia
Category:Video games set in feudal JapanQ:
How to get the last row in a DataTable
I'm currently using the following function to get the last row in a DataTable:
public DataRow GetLastRow(DataTable datatable)
{
// Retrieve the table row index
int lastRowIndex = datatable.Rows.Count - 1;
// Move to the last row
DataRow lastRow = datatable.Rows[lastRowIndex];
return lastRow;
}
Does anyone know if there is a more efficient way of doing this? I've not found anything similar, using google.
A:
According to this, your way is the most efficient. You can put the logic in a function, as well.
var lastRow = datatable.Rows[datatable.Rows.Count - 1];
A:
This is what I was looking for.
public DataRow GetLastRow(DataTable datatable)
{
// Retrieve the table row index
int lastRowIndex = datatable.Rows.Count - 1;
// Move to the last row
DataRow lastRow = datatable.Rows[lastRowIndex];
return lastRow;
}
7
+
5
8
.
L
e
t
g
=
c
-
-
2
6
.
W
h
a
t
i
s
t
h
e
s
e
c
o
n
d
s
m
a
l
l
e
s
t
v
a
l
u
e
i
n
0
.
2
,
- ac619d1d87
Related links:
Commentaires