I want to try to save the result of this query (I want to get the value of the primary key) into a variable in c# of a MDB database but I don't know how I can do it:
SELECT @@identity FROM Table
I've tried this but it doesn't work:
int variable;
variable = cmd.CommandText("SELECT @@IDENTITY FROM TABLE");
PD: It isn't all the code, I have a problem only with this part.
ExecutScalar()