I want to find out the maximum value in this situation.
dataset = dataset11
Table name = Student
Column name = RegistrationID
txtMaxRegistrationID.text = dataset11.Student.RegistrationID ??
Please help i am a beginner with VB.
Printable View
I want to find out the maximum value in this situation.
dataset = dataset11
Table name = Student
Column name = RegistrationID
txtMaxRegistrationID.text = dataset11.Student.RegistrationID ??
Please help i am a beginner with VB.
hey
Try using the MAX function in the
select query on the DataSet:
dataset11.Select("SELECT MAX(RegistarationID) FROM [Student]...")
why do you not just use a dataview?
rough code
dv as new dataview(dataset11.Student)
dv.sort="RegistrationIdColumn, ASC"
txtMaxRegistrationId.text=dv(dv.count-1)("RegistrationID")
Hey I want to know how to use other functions like MAX in the sql statement using vb.net.
I found the easiest way for this
DataTable.Compute function.
txtMaxStaffID.text = dataset11.Employee.Compute("Max(StaffID)", Nothing)
The second parameter is a filter, incase you want to limit the rows that are
applied to the aggregate function.
David Sceppa's book "Microsoft ADO.NET - Core Reference" from MS Press
covers the DataTable.Compute function along with every thing else in
ADO.NET!