How to retrieve last primary Id from mdb's table?
- by William
I got table with next columns: Id, Name, Age, Class
I am trying to insert new row in db like this:
INSERT INTO MyTable (Name, Age, Class)
VALUES (@name, @age, @class)
And get an exeption:
"Index or primary key cannot contain a Null value."
The question is how to add a new row without knowing next primary Id, or maybe there is a way to get this Id from the table with the help of another query ?