分頁sql
select * from
(
select row_number() over(order by 總額 desc) as rownumber, t.RealName,t.Name, t.提交數, t.總額 from
(select b.RealName,c.Name,count(*) 提交數,sum(a.Money) 總額 from YX_SALE a left join Tb_Common_User b on a.WorkNO=b.WorkNO left join WFT_Network c on a.NetworkNO=c.NetworkNO where b.BankSear='003059105285' and a.ProductType='1'
group by b.RealName,c.Name) t
) temp where rownumber between (1-1)*6 and 1*6
一般處理程序
protected HttpRequest Request;
protected HttpResponse Response;
protected HttpSessionState Session;
protected HttpServerUtility Server;
protected HttpApplicationState Application = HttpContext.Current.Application;
protected dbo conn = common.make();
protected JsonConvert<object> jc = new JsonConvert<object>();
//protected UserInfo ui = new UserInfo();
public void ProcessRequest(HttpContext context)
{
//不讓瀏覽器緩存
context.Response.Buffer = true;
context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
context.Response.AddHeader("pragma", "no-cache");
context.Response.AddHeader("cache-control", "");
context.Response.CacheControl = "no-cache";
context.Response.ContentType = "text/plain";
#region 設置允許跨域,允許複雜請求
//header("Access-Control-Allow-Origin: *"); # 跨域處理
context.Response.AddHeader("Access-Control-Allow-Origin", "*");
if (context.Request.HttpMethod == "OPTIONS")
{
context.Response.AddHeader("Access-Control-Allow-Methods", "GET,POST,PUT,DELETE,PATCH,OPTIONS");
context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept, Authorization");
//header('Access-Control-Allow-Headers:x-requested-with'); //php設置
//response.addHeader("Access-Control-Allow-Origin", "*");
context.Response.AddHeader("Access-Control-Allow-Headers", "x-requested-with");
//HttpContext.Current.Response.AddHeader("Access-Control-Max-Age", "1728000");
context.Response.End();
}
#endregion
Request = context.Request;
Response = context.Response;
Session = context.Session;
Server = context.Server;
string method = context.Request["Method"].ToString();
MethodInfo methodInfo = this.GetType().GetMethod(method);
methodInfo.Invoke(this, null);
}
asp.net一份配置文件,鏈接sql 寫法
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings>
<add key="IsBank" value="false" />
</appSettings>
<connectionStrings>
<clear />
<!--
Access的寫法:
<add name="ConnectionSetting" connectionString="database/gis.mdb"
providerName="OleDB" />
Oracle的寫法:
<add name="ConnectionSetting" connectionString="Provider=MSDAORA.1;Data Source=Wish;Persist Security Info=False;User ID=scott;password=tiger;"
providerName="Oracle" />
-->
<add name="ConnectionSetting" connectionString="Server=www.xxx.xxx,56001;uid=sa;pwd=*****;database=******pooling=true;Max Pool Size = 2000;" providerName="SQLServer" />
</connectionStrings>
<system.web>
<!--<sessionState mode="StateServer" stateConnectionString="tcpip=127.0.0.1:42424" timeout="30"></sessionState>-->
<httpRuntime maxRequestLength="15360" useFullyQualifiedRedirectUrl="true" executionTimeout="6000" minFreeThreads="8" minLocalRequestFreeThreads="4" requestValidationMode="2.0" appRequestQueueLimit="100" enableVersionHeader="true" />
<pages enableViewStateMac="false" enableSessionState="true" validateRequest="false" enableEventValidation="false" controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID">
<controls>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit" />
<add tagPrefix="webdiyer" namespace="Wuqi.Webdiyer" assembly="AspNetPager" />
<add tagPrefix="anthem" namespace="Anthem" assembly="Anthem" />
</controls>
</pages>
<!-- 動態調試編譯
設置 compilation debug="true" 以啓用 ASPX 調試。否則,將此值設置爲
false 將提高此應用程序的運行時性能。
設置 compilation debug="true" 以將調試符號(.pdb 信息)
插入到編譯頁中。因爲這將創建執行起來
較慢的大文件,所以應該只在調試時將此值設置爲 true,而在所有其他時候都設置爲
false。有關更多信息,請參考有關
調試 ASP.NET 文件的文檔。
-->
<compilation defaultLanguage="c#" debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
</compilation>
<!-- 自定義錯誤信息
設置 customErrors mode="On" 或 "RemoteOnly" 以啓用自定義錯誤信息,或設置爲 "Off" 以禁用自定義錯誤信息。
爲每個要處理的錯誤添加 <error> 標記。
"On" 始終顯示自定義(友好的)信息。
"Off" 始終顯示詳細的 ASP.NET 錯誤信息。
"RemoteOnly" 只對不在本地 Web 服務器上運行的
用戶顯示自定義(友好的)信息。出於安全目的,建議使用此設置,以便
不向遠程客戶端顯示應用程序的詳細信息。
-->
<customErrors mode="Off" />
<!-- 身份驗證
此節設置應用程序的身份驗證策略。可能的模式是 "Windows"、
"Forms"、 "Passport" 和 "None"
"None" 不執行身份驗證。
"Windows" IIS 根據應用程序的設置執行身份驗證
(基本、簡要或集成 Windows)。在 IIS 中必須禁用匿名訪問。
"Forms" 您爲用戶提供一個輸入憑據的自定義窗體(Web 頁),然後
在您的應用程序中驗證他們的身份。用戶憑據標記存儲在 Cookie 中。
"Passport" 身份驗證是通過 Microsoft 的集中身份驗證服務執行的,
它爲成員站點提供單獨登錄和核心配置文件服務。
-->
<authentication mode="Forms">
<forms name="j****t" loginUrl="/login.aspx" defaultUrl="login.aspx" protection="All">
</forms>
</authentication>
<authorization>
<allow users="*" />
</authorization>
<!-- 應用程序級別跟蹤記錄
應用程序級別跟蹤爲應用程序中的每一頁啓用跟蹤日誌輸出。
設置 trace enabled="true" 可以啓用應用程序跟蹤記錄。如果 pageOutput="true",則
在每一頁的底部顯示跟蹤信息。否則,可以通過瀏覽 Web 應用程序
根目錄中的 "trace.axd" 頁來查看
應用程序跟蹤日誌。
-->
<trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true" />
<!-- 會話狀態設置
默認情況下,ASP.NET 使用 Cookie 來標識哪些請求屬於特定的會話。
如果 Cookie 不可用,則可以通過將會話標識符添加到 URL 來跟蹤會話。
若要禁用 Cookie,請設置 sessionState cookieless="true"。
-->
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" />
<!-- 全球化
此節設置應用程序的全球化設置。
-->
<!--
<globalization fileEncoding="gb2312" requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN" />
加上上面這個,echarts中文就會亂碼
-->
<httpHandlers>
<add verb="POST,GET" path="ajax/*.ashx" type="Ajax.PageHandlerFactory, Ajax" />
</httpHandlers>
<xhtmlConformance mode="Legacy" />
</system.web>
<system.webServer>
<!--爲了支持跨域-->
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*"/>
<add name="Access-Control-Allow-Headers" value="X-Requested-With"/>
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS"/>
</customHeaders>
</httpProtocol>
<validation validateIntegratedModeConfiguration="false" />
<defaultDocument>
<files>
<remove value="default.aspx" />
<remove value="iisstart.htm" />
<remove value="index.html" />
<remove value="index.htm" />
<remove value="Default.asp" />
<remove value="Default.htm" />
<add value="Login.aspx" />
</files>
</defaultDocument>
<modules runAllManagedModulesForAllRequests="true">
<remove name="Session" /><!--此處刪除Session是爲了Url重寫刪除後無法使用Session因此重新添加了一個Session-->
<add name="Session" type="System.Web.SessionState.SessionStateModule"/>
</modules>
</system.webServer>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4" compilerOptions="/d:DEBUG;TRACE">
<providerOption name="CompilerVersion" value="v4.0" />
</compiler>
</compilers>
</system.codedom>
<location path="Web">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
</configuration>