I want to get primarykey ID of just inse开发者_开发技巧rt item. In PHP has mysql_insert_id(). I write in C#
If cmd is your command object try:
cmd.LastInsertId;
You have to query the database directly.
SELECT last_insert_id() FROM mytable;
So say with ODBC
object lastID = new OdbcCommand("SELECT last_insert_id() FROM mytable", _connection).ExecuteScalar();
精彩评论