• λ我爱Aspx >> Asp.Net >> 存储过程分页
  • 存储过程分页

  • :未知  Դ:internet  :2007-5-20 16:44:46  ؼ:
  • public static string Sql_Parm = @Sql ; // 检索行数

    public static string PageSize_Parm = @PageSize ; // 向分页存储过程里传入的 每页显示行数的值

    public static string PageCurrent_Parm = @PageCurrent ; // 当前显示的页码

    public static string FdShow_Parm = @FdShow ; // 传入返回时要显示的列,用逗号隔开。例:col1,col2

    public static string FdOrder_Parm = @FdOrder ; // 排序

    public SqlCommand GetCommand()

    {

    if ( SelectCommand == null )

    {

    SelectCommand = new SqlCommand( P_Show , new SqlConnection(DbCFG.ConnectionString) ) ;

    SelectCommand.CommandType = CommandType.StoredProcedure ;

    SelectCommand.Parameters.Add(new SqlParameter(QueryStr_Parm, SqlDbType.NVarChar, 4000 )) ;

    SelectCommand.Parameters.Add(new SqlParameter(Sql_Parm, SqlDbType.NVarChar, 4000 )) ;

    SelectCommand.Parameters.Add(new SqlParameter(PageSize_Parm , SqlDbType.Int)) ;

    SelectCommand.Parameters.Add(new SqlParameter(PageCurrent_Parm , SqlDbType.Int)) ;

    }

    return SelectCommand ;

    }

    Ҷƪл˵?
  • һƪSQL Server 索引结构及其使用(一)
    һƪSQL在存储过程中使用递归