string sql = "insert into [table] values()SELECT SCOPE_IDENTITY()";
cmd.CommandText = strSql;
cmd.Connection = cn;
cn.Open();
OleDbDataReader oleread = cmd.ExecuteReader();
if(oleread.Read())
{
id = int.Parse(oleread[0].ToString());
}
oleread.Close();
cn.Close();
重致自增种子:
要么使用truncate table或者DBCC CHECKIDENT (你的表名, RESEED, 1)来重致自增种子