在网上找到了一个通用分页的SQL存储过程, 但是不会用 谁有例子 或教程 发一下啊

解决方案 »

  1.   

    你会用写个  SQL 语句  就会存储了 ~~~
      

  2.   

    create Procedure Pro_Page
    (
    @PageSize int,
    @PageIndex int,
    @PageCount int output
    )
    as
    create table #Temp
    (
    NID int identity(1,1),
    PID int
    )
    insert into #Temp select ProductID from Prodcuts
    select @PageCount=count(*) from Prodcuts;
    ..........
      

  3.   

    cmd = new SqlCommand("proc_paging", con);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.Add("pageSize", SqlDbType.Int).Value = page.PageSize;reader = cmd.ExecuteReader();