public int retrieveID()
{
int lastEntry = 0;
try
{
queryString = "Select ID from Database";
myComm = new OleDbCommand(queryString, myConn);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return lastEntry;
}
I want to retrieve the last primary key used in access database, whereas i set my primary key as autonumber.
elaborating more..
I am working on a database application and want to utilize the primary key, eg if the last entry in the database was 10, i want to retrieve 10, i tried simple query but that didnot work.