淺析asp.net 和 access 聯(lián)合開發(fā)的分頁類_.Net教程

      編輯Tag賺U幣
      教程Tag:暫無Tag,歡迎添加,賺取U幣!

      推薦:在ASP.Net Ajax中調(diào)用WebService
      今天我想實現(xiàn)利用JavaScript調(diào)用WebService我首先就想到了ASP.Net Ajax 因為微軟的東西用著方便,我從網(wǎng)上看了看,這東西好多人都寫了,我就從官方找了個Demo下了看看源代碼,感覺沒什么特殊的

      以下為引用的內(nèi)容:
      using System;
      using
      System.Collections.Generic;
      using
      System.Text;
      using
      System.Data;
      namespace
      pager
      {
      public class
      Pager
      {
      /// <summary>

      ///
      /// </summary>
      /// <param name="strWhere">條件</param>
      /// <param name="pagesize">每頁顯示條數(shù)</param>
      /// <param name="pageindex">第幾頁</param>
      /// <param name="orderCol">排序</param>
      /// <param name="TableName">表名</param>
      /// <returns></returns>
      public static string GetPager(string strWhere, int pagesize, int pageindex, string orderCol, string TableName)
      {
      if (pageindex == 1
      )
      {
      return "select top " pagesize.ToString() " * from " TableName.ToString() " order by " orderCol.ToString() " DESC"
      ;
      }
      else

      {
      StringBuilder strSql
      = new StringBuilder();
      strSql.AppendFormat(
      "select top {0} * from {1} "
      , pagesize, TableName);
      strSql.AppendFormat(
      " where {1} not in (select top {0} id from {2} ", pagesize * (pageindex - 1
      ), orderCol, TableName);
      if (strWhere.Trim() != ""
      )
      {
      strSql.AppendFormat(
      " where {0} order by {1} DESC) and {0}"
      , strWhere, orderCol);
      }
      else

      {
      strSql.AppendFormat(
      " order by {0} DESC) ", orderCol);
      }
      strSql.AppendFormat(
      " order by {0} DESC"
      , orderCol);
      return
      strSql.ToString();
      }
      }
      }
      }

      分享:asp.net 獲取客戶端IP與mac
      獲取客戶端IP: 以下為引用的內(nèi)容: private string GetClientIP() { string result = HttpContext.Current.Request.ServerVari

      來源:模板無憂//所屬分類:.Net教程/更新時間:2009-09-07
      相關(guān).Net教程