How to get max value from table (Access 2003 vs VB.net 2005)

Posted on 2009-12-20
Medium Priority
Last Modified: 2013-11-29
Dear Experts,

i have 1 table (tbl_reg) with 2 fields (reg_no, reg_name) in access 2003.
in VB.net 2005, i want to get the max value for reg_no.

pleas help, how to code this?

Question by:oohoo_u
LVL 61

Expert Comment

ID: 26093420
select max(reg_no) as MaxRegNo from myTable

Accepted Solution

Trideep Patel earned 150 total points
ID: 26093738
If you want to fetch it after fill to datatable u can use Compute as following

 MessageBox.Show(ds.Tables(0).Compute("MAX(EmpID)", ""))

Author Closing Comment

ID: 31668384
it should be worked

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question