| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 829 人关注过本帖
标题:求助各高手 版主 分页问题(网上找不到)
只看楼主 加入收藏
tcapple486
Rank: 1
等 级:新手上路
帖 子:50
专家分:0
注 册:2007-4-19
收藏
 问题点数:0 回复次数:0 
求助各高手 版主 分页问题(网上找不到)
Sub show()
        If (Not IsPostBack) Then
            Dim conn As SqlConnection
            Dim ConnectionString As String = "server=(local);database=test;uid=sa;pwd= ;"
            conn = New SqlConnection(ConnectionString)
            Dim sql As String = "SELECT * From 会员表"
            Dim myCommand As SqlCommand
            Dim myDataDeader As SqlDataReader
            myCommand = New SqlCommand(sql, conn)
            conn.Open()
            DataGrid1.DataSource = myCommand.ExecuteReader()
            DataGrid1.DataBind()
            conn.Close()
        End If
    End Sub
Sub DataGrid1_page(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs)
        Dim startIndex As Integer
        startIndex = DataGrid1.CurrentPageIndex * DataGrid1.PageSize
        DataGrid1.CurrentPageIndex = e.NewPageIndex
        show()
    End Sub
还有一个问题是 我想返回datagrid的页数到label 可就不成功 数值一直维持1不变
代码为Label1.Text = DataGrid1.PageCount  后该为Label1.Text = DataGrid1.PageCount.tostring() 都不成  顺便给我讲讲tostring()是如何用 什么时候用--这有点迷惑
搜索更多相关主题的帖子: Dim 版主 conn myCommand 
2007-11-25 22:13
快速回复:求助各高手 版主 分页问题(网上找不到)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.057977 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved