你是否填充(Fill())了dataSet11?
解决方案 »
- 如何获取服务器盘的文件夹
- 水晶报表
- 请教各位大虾,像CSDN那种楼主,1,2,3.。。楼这样排序下去是怎么做的?
- msxml2.serverxmlhttp在asp.net下的假死现象
- 这个模态对话框怎么做?
- 在asp.net中用treeview遇到问题,如何编译
- 求救!在datagrid的摸板列中放一个HyperLink 怎样进行绑定数据??
- 简单的DataGrid问题:如何查找DataGrid里的超级链接列?谢谢!
- 如何将大类和小类读入treeview控件???
- 关于邮件发送遇到的问题
- 系统提示错误The viewstate is invalid for this page and might be corrupted.
- 简单的问题啊。
<%@ Page Language="VB" AutoEventWireup="True" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %><html>
<script runat="server">
dim MyConnection as OleDbConnection
dim cmdSelect as OleDbCommand
dim dtrReader as OleDbDataReader Sub Page_Load(sender As Object, e As EventArgs)
MyConnection = New OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=c:\inetpub\wwwroot\nhonline\datagrid\kk.mdb") If Not IsPostBack Then
BindGrid()
End If
End Sub Sub MyDataGrid_Page(sender as Object, e As DataGridPageChangedEventArgs)
MyDataGrid.CurrentPageIndex = e.NewPageIndex
BindGrid()
End Sub Sub BindGrid()
Dim MyCommand As OleDbDataAdapter = new OleDbDataAdapter("select * from [min]", MyConnection)
Dim DS As DataSet = new DataSet()
MyCommand.Fill(DS,"min")
MyDataGrid.DataSource =DS.Tables("min").DefaultView
MyDataGrid.DataBind()
End Sub </script><body> <form runat="server">
<h3> DataGrid Custom Paging Example </h3> <asp:DataGrid id="MyDataGrid"
AllowCustomPaging="True"
AllowPaging="True"
PageSize="2"
OnPageIndexChanged="MyDataGrid_Page"
runat="server"> <HeaderStyle BackColor="Navy"
ForeColor="White"
Font-Bold="True" /> <PagerStyle Mode="NumericPages"
HorizontalAlign="Right" /> </asp:DataGrid> </form></body>
</html>
是否应这样呢?你试试