andycharger
Centurion
- Joined
- Apr 2, 2003
- Messages
- 152
Hi all.
Im trying to get the id of a record I have just added in my database. As it will be the last record im doing:-
"select max from errors"
Trouble is, im not sure how to get the field I want from the record!!!
For example, I can get an entire row back, stick it in a sqldatareader and put it in a datagrid.
But that is not what I want. I dont want to put it in a datagrid, I just want to get the ID of the row and assign it to a variable so I can reuse it.
Can someone show me how I do this?
Cheers.
Andy
Im trying to get the id of a record I have just added in my database. As it will be the last record im doing:-
"select max from errors"
Trouble is, im not sure how to get the field I want from the record!!!
For example, I can get an entire row back, stick it in a sqldatareader and put it in a datagrid.
But that is not what I want. I dont want to put it in a datagrid, I just want to get the ID of the row and assign it to a variable so I can reuse it.
Can someone show me how I do this?
Cheers.
Andy