CREATE PROCEDURE GetRecordFromPage_Edit    @sqlstr      varchar(2555),       -- 表名
    @pagecount    int = 1    ,       -- 页码
    @pagesize     int = 10         -- 页尺寸
    AS
    
  set   nocount   on   
  declare   @P1   int, --P1是游标的id     @rowcount   int     exec   sp_cursoropen   @P1   output,@sqlstr,@scrollopt=1,@ccopt=1,@rowcount=@rowcount   output   
  
  set   @pagecount=(@pagecount-1)*@pagesize+1   
  exec   sp_cursorfetch   @P1,16,@pagecount,@pagesize     
  exec   sp_cursorclose   @P1
GO这么定义的 。 在查询分析器中能返回结果可是在  asp.NEt 中调用 ,就没有返回结果 ,请大家帮忙看看是那的问题呀

解决方案 »

  1.   

    程序就是一个字符串参数呀
     string strsql = "select * from [Menhus2.1_Collections].dbo.NewsTable where " + strWhere;
                 SqlParameter[] parms = {
        
                new SqlParameter("@sqlstr", SqlDbType.VarChar,2555),
                new SqlParameter("@pagecount", SqlDbType.Int),
                new SqlParameter("@pagesize", SqlDbType.Int)
             
                };             parms[0].Value = strsql;
                 parms[1].Value = PageSize;
                 parms[2].Value = PageIndex;