当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

    摘要: 现有连台pc,os为win98.每台pc装有10/100mb自适应网卡, 如果想要两台pc同时通过其中的一台(已接通adsl)上网, 请问:双绞线的线序?    win98的设置(ip)?    如果使用hub或者交换机,win98如何设置? 急用!请速回!分不够可再加! ......
 ·win2000的补丁限制权限    »显示摘要«
    摘要: 我的win2000pro(sp4)刚安装完的时候,还是可以运行iis控制台的,一上微软的网站升级系统补丁后,就不能运行iis的控制台了。这是这么回事? 还有,一些文件的属性菜单也不能打开了,无法修改一些文件的属性了。 谁能帮我解释一下原因?怎样解决问题? ......


分页的问题,困扰了我一天,大江帮忙指点一下,第三次贴出来

我在原来的程序进行分页显示,把孟子的程序改了一下。我有几个地方不清楚,1。孟子的第一行的Inherits="DataGridPaging"不能加进去,2。Page_Load中有Handles   MyBase   .Init,作用是什么,我不清楚,我把它直接抄下来了。  
  3.dgSearch   Result_Page中,startIndex的作用我不清楚,但是程序中别处也没有出现这个,我就直接抄下来了。  
  我原以为这几个地方会出问题,结果系统提示:dgSearchResult.CurrentPageIndex=e.NewPageIndex     编译错误,Reference   to   a   non-shared   member   requires   an   object   reference,这个问题困扰了我一整天,网上问了几次也没解决,似乎不是很大的问题,但是我却没能作出来,我把编译结果和源代码贴出来,大家帮忙指点一下。  
  Compilation   Error    
  Description:   An   error   occurred   during   the   compilation   of   a   resource   required   to   service   this   request.   Please   review   the   following   specific   error   details   and   modify   your   source   code   appropriately.    
  Compiler   Error   Message:   BC30469:   Reference   to   a   non-shared   member   requires   an   object   reference.  
  Source   Error:  
  Line   47:           Dim   startIndex   As   Integer  
  Line   48:           startIndex   =   MyDataGrid.CurrentPageIndex   *   MyDataGrid.PageSize  
  Line   49:           dgSearchResult.CurrentPageIndex   =   e.NewPageIndex  
  Line   50:           BindGrid()  
  Line   51:       End   Sub  
   
  程序源码:  
  <%@   Page   Language=VB   EnableSessionState=true   Debug=true   AutoEventWireup="false"   %>  
  <%@   Import   Namespace="System.Data"   %>  
  <%@   Import   Namespace="System.Web.UI"   %>  
  <%@   Import   Namespace="System.Data.SqlClient"   %>  
   
  <HTML>  
  <HEAD>  
  <meta   content="Visual   Basic   7.0"   name="CODE_LANGUAGE">  
          <meta   content="JavaScript"   name="vs_defaultClientScript">  
          <meta   content="http://schemas.microsoft.com/intellisense/ie5"   name="vs_targetSchema">  
   
  <TITLE>Search   Results</TITLE>  
  <script   runat="server">  
  Public   Class   DataGridPaging  
      Inherits   System.Web.UI.Page  
   
      Protected   WithEvents   MyDataGrid   As   System.Web.UI.WebControls.DataGrid  
      Protected   WithEvents   btnFirst   As   System.Web.UI.WebControls.LinkButton  
      Protected   WithEvents   btnPrev   As   System.Web.UI.WebControls.LinkButton  
      Protected   WithEvents   btnNext   As   System.Web.UI.WebControls.LinkButton  
      Protected   WithEvents   btnLast   As   System.Web.UI.WebControls.LinkButton  
      Protected   WithEvents   lblCurrentIndex   As   System.Web.UI.WebControls.Label  
      Protected   WithEvents   lblPageCount   As   System.Web.UI.WebControls.Label  
      Protected   WithEvents   DataGrid1   As   System.Web.UI.WebControls.DataGrid  
   
  #Region   "   Web   Form   Designer   Generated   Code   "  
   
      This   call   is   required   by   the   Web   Form   Designer.  
      <System.Diagnostics.DebuggerStepThrough()>   Private   Sub   InitializeComponent()  
   
      End   Sub  
   
      Private   Sub   Page_Init(ByVal   sender   As   System.Object,ByVal   e   As   System.EventArgs)   Handles   MyBase.Init  
          CODEGEN:   This   method   call   is   required   by   the   Web   Form   Designer  
          Do   not   modify   it   using   the   code   editor.  
          InitializeComponent()  
      End   Sub  
   
  #End   Region  
   
      Private   Sub   Page_Load(ByVal   sender   As   System.Object,ByVal   e   As   System.EventArgs)   Handles   MyBase.Load  
          OpenDatabase()  
          BindGrid()  
      End   Sub  
       
      Sub   dgSelectResult_Page(ByVal   sender   As   Object,   ByVal   e   As   DataGridPageChangedEventArgs)  
          Dim   startIndex   As   Integer  
          startIndex   =   MyDataGrid.CurrentPageIndex   *   MyDataGrid.PageSize  
          dgSearchResult.CurrentPageIndex   =   e.NewPageIndex  
          BindGrid()  
      End   Sub  
   
      Sub   BindGrid()  
          Dim   DBConn   as   SqlConnection  
          Dim   DBCommand   As   SqlDataAdapter  
          Dim   DSPageData   as   New   DataSet  
        if     Session("Search")="Null"  
                  lblCount.Text   =   "请正确输入查询条件"            
      else   If   Session("SearchSQLJihua")   =   nothing   Then  
        If   Session("SearchSQLJihua")=nothing   Then  
          DBCommand   =   New   SqlDataAdapter   _  
                  (Session("SearchSQLRizhi"),DBConn)    
          DBCommand.Fill(DSPageData,   _  
                  "rizhi")  
                  dgSearchResult.DataSource   =   _  
                          DSPageData.Tables("rizhi").DefaultView  
                  dgSearchResult.DataBind()  
                  If   DSPageData.Tables("rizhi").Rows.Count   =   1   Then  
                  lblCount.Text   =   "你从日志表中查到了1条记录."  
          Else    
                  lblCount.Text   =   "你从日志表中查到了   "   _  
                          &   DSPageData.Tables("rizhi").Rows.Count   _  
                          &   "   条记录."  
              End   If  
              Session("SearchSQLRizhi")   =   nothing    
           
      Else   If   Session("SearchSQLRizhi")   =   nothing   Then  
                  DBCommand   =   New   SqlDataAdapter   _  
                  (Session("SearchSQLJihua"),DBConn)    
          DBCommand.Fill(DSPageData,   _  
                  "jihua")  
                  dgSearchResult.DataSource   =   _  
                          DSPageData.Tables("jihua").DefaultView  
                  dgSearchResult.DataBind()  
          If   DSPageData.Tables("jihua").Rows.Count   =   1   Then  
                  lblCount.Text   =   "你从计划表中查找有1条记录."  
    Else  
                  lblCount.Text   =   "你从计划表中查到了   "   _  
                          &   DSPageData.Tables("jihua").Rows.Count   _  
                          &   "   条记录."  
          End   If  
            Session("SearchSQLJihua")   =   nothing    
         
                         
    End   IF  
   
      End   Sub  
  Dim   DBConn   as   SqlConnection  
      Public   Sub   OpenDatabase()  
          DBConn   =   New   SqlConnection("server=(local);"   _  
                  &   "Initial   Catalog=gzhb;"   _  
                  &   "User   Id=sa;"   _  
                  &   "Password=yourpassword;"   _  
                  &   "Trusted_Connection=yes;")  
      End   Sub  
  End   Class  
  </script>  
  </HEAD>  
  <BODY   BACKGROUND="./house-wide.gif"   TEXT="purple"   LINK="blue"   VLINK="black"   ALINK="red"  
  LEFTMARGIN="150">  
  <Form   runat="server"   ID="Form1">  
  <asp:Label   id="lblTitle"   BorderWidth="5px"   BorderStyle="7"   BackColor="lightyellow"   Width="439"  
  Font-Size="22pt"   Font-Name="Comic   Sans   MS"   Text="<CENTER>查询历史记录</CENTER>"   runat="server"   />  
  <P></P>  
  <asp:Label   id="lblCount"   Font-Size="15pt"   Font-Name="Comic   Sans   MS"   runat="server"   />  
  <P></P>  
  <ASP:DataGrid   id="dgSearchResult"   Width="90%"   BackColor="beige"   AlternatingItemStyle-BackColor   =   "cornsilk"BorderColor="black"   ShowFooter="false"   CellPadding="3"   CellSpacing="0"   Font-Name="Arial"   Font-Size="8pt"ForeColor="Black"   AllowPaging="True"   HeaderStyle-BackColor="burlywood"   PageSize="5"   OnPageIndexChanged   ="dgSearchResult_Page"   HeaderStyle-Font-Bold="True"   runat="server"   PagerStyle-Mode="NumericPages"  
  ></ASP:DataGrid>  
  </Form>  
        </BODY>  
  </HTML>  
     
 

NO.1   作者: xydyh

你没有了解分页的本质!照抄是不行的。学会自己控制!

NO.2   作者: maplebridge

其实不需要那么复杂的,你在datagrid改了属性,然后再加响应事件就可以了


 ·linux中的磁盘配额    »显示摘要«
    摘要: 当win2k的某一个磁盘是ntfs格式的时候,我们可以对此分区进行磁盘配额,在linux中,我知道有quota这样一组参数,可以用来做磁盘配额,但是具体如何来操作就要请各位高手多多指教了!(本人操作系统redhat 9.0)万分感谢! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE