i have a one datatable in this i want to get the maximum userId no the values are 1,2,3,4,5,6,7,8,9,10...suppose i use max(userId) it always display 9 why because the column values is treat as string type that's why i want convert that string values into integers how to achive this one is there any way to solve this issue.....
my code:
DataRow[] drs = ds.Tables[0].Select("UserId=MAX(CONVERT(Child.UserId,'System.Int32')");
var d =(object)ds.Tables[0].Compute("MAX(UserId)", "UserId>0");
Loading
Koteswararao MallisettiPosted Aug 31, 2010, 10:30 AM
'o' means
Manikavelu VelayuthamPosted Aug 31, 2010, 6:30 AM
var dstemp =
ds.
Select(c => c.UserId).
Max(o => o.UserId);
like this you need to implement it.
Koteswararao MallisettiPosted Aug 31, 2010, 5:56 AM
Koteswararao MallisettiPosted Aug 31, 2010, 5:36 AM
Manikavelu VelayuthamPosted Aug 31, 2010, 5:21 AM