<asp:DataGrid ID="" Runat="server" AllowPaging="True" GridLines="Both" OnPageIndexChanged="MyDataGrid_Page" PageSize="5" ></asp:DataGrid>public ICollection CreateSource()
{     
string sql="select ...";
DataSet ds=new DataSet(); OleDbConnection myOleDbConnection=new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:/1.xls;Extended Properties=Excel 8.0;");
OleDbCommand myOleDbCommand=new OleDbCommand(sql,myOleDbConnection); myOleDbConnection.Open();
OleDbDataAdapter da=new OleDbDataAdapter(sql,myOleDbConnection);
da.Fill(ds,"sheet1");
return ds.Tables["sheet1"].DefaultView;
}public void MyDataGrid_Page(Object sender, DataGridPageChangedEventArgs e) 
{
//由内置页导航使用。CurrentPageIndex 已设置
show.CurrentPageIndex = e.NewPageIndex;
BindGrid();
} public void BindGrid() 
{
show.DataSource = CreateSource();
show.DataBind();
}