public void AddUser(users user)
       {
           sql = "insert into users values(@LoginPwd,@Name)";
           SqlParameter[] para = new SqlParameter[]
           {
               new SqlParameter("@LoginPwd",user.LoginPwd),
        new SqlParameter("@Name",user.Name)
           };
           dbHalper.ExecuteCommand(sql, para);  
       }
//users表里面有3列(id,LoginPwd,Name)

  public int ExecuteCommand(string sql, params SqlParameter[] values)
        {
            try
            {
                OpenConnection();
                SqlCommand cmd = new SqlCommand(sql, connection);
                cmd.Parameters.AddRange(values);
                return cmd.ExecuteNonQuery();
            }
            finally
            {
                CloseConnection();
            }
        }

问:上面的代码怎么能在插入的同时让他返回标示列???

注:假如不用预编译的SQL用sql="Insert Into users (LoginPwdName,name) values ('" + LoginPwd + "','" + Name + "') SELECT @@IDENTITY"就可以实现