<%@ Page Language="VB" AutoEventWireup="True" Debug="true"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server">
     
dim MyConnection as OleDbConnection

      
Sub Page_Load(sender As Object, e As EventArgs) 
          MyConnection 
= New OleDbConnection( "Provider=Microsoft.Jet.OLEDB.4.0; Data Source =" + Server.MapPath(".")+"/db/data.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>

<script language = "javascript">        
startHighlight 
= function()
{                
    
if (document.all && document.getElementById)
    {
        navRoot 
= document.getElementById("MyDataGrid");
            
        
// Get a reference to the TBODY element 
        tbody 
= navRoot.childNodes[0];

        
for (i = 1; i < tbody.childNodes.length - 1 ; i++)    
        {
            node 
= tbody.childNodes[i];
            
if (node.nodeName == "TR")
            {
                node.onmouseover
=function()
                {
                    this.className 
= "over";                                
                }
                    
                node.onmouseout
=function()
                {
                    this.className 
= this.className.replace("over""");
                }
            }
        }
    }
}
    
window.onload 
= startHighlight;            
</script>

<style>
  tr:hover, tr.over td { background
-color: #ffcc00;
</style>

<Body>
<form runat="server">
    
<asp:DataGrid id="MyDataGrid" 
           AllowPaging
="True" 
           PageSize
="5" 
           OnPageIndexChanged
="MyDataGrid_Page" 
           runat
="server"
           AutoGenerateColumns="False"
           Width="200">
         
<HeaderStyle BackColor="Navy" 
                      ForeColor
="White" 
                      Font
-Bold="True" 
                      HorizontalAlign
="Center"/>
         
<PagerStyle Mode="NextPrev"
                     HorizontalAlign="Right" 
                     NextPageText
="Next"
                     PrevPageText="Prev"/>
      
<HeaderStyle BackColor = "#336699" ForeColor = "#ffffff" Font-Bold = "true" />
      
<AlternatingItemStyle BackColor = "#eeeeee" />
      
<Columns>
         
<asp:BoundColumn DataField="id" HeaderText="ID"/>
         
<asp:TemplateColumn HeaderText="zhuti">
            
<ItemTemplate>
                
<asp:Label ID="lblTotalPrice"  Text='<%#(Container.DataItem("zhuti"))%>' Runat=server />            
            </ItemTemplate> 
        
</asp:TemplateColumn> 
      
</Columns>
      
</asp:DataGrid>
</form>
</Body>