Ajax得到服务器生成的文件流,下载

摘要: 前台: vardownloadFrame;functiondoHisRPTDownload() {varperiod=$("#"+"<%=MonthSelect.ClientID%>").val();// Check to be sure this async postback is actually requesting the file download.if(!downloadFrame) {downloadFrame=document.createElement("iframe");// Add the IFRAM 阅读全文
posted @ 2013-03-23 21:49 Amity 阅读(826) 评论(0) 推荐(0) 编辑

Windows身份认证,通过活动目录得到用户信息

摘要: 1//获取到域名stringdomainName=HttpContext.Current.User.Identity.Name;UserManagermanager=newUserManager();EmpInfoempInfo=manager.GetUserInfo(domainName);2publicstringGetEmpId(stringdomainName){stringid=string.Empty;if(!string.IsNullOrEmpty(domainName)){string[]parts=domainName.Split(newstring[] {"\\& 阅读全文
posted @ 2013-03-23 21:44 Amity 阅读(308) 评论(0) 推荐(0) 编辑

sql--分页

摘要: createprocsp_proInfo_paging(@pageSizeint=7,@pageNoint=1)asbegindeclare@totalCountintset@totalCount=(selectCOUNT(*)fromPROJECT_INFO)if@pageNo>CEILING(@totalCount*1.0/@pageSize)beginset@pageNo=@pageNo%@pageSizeif@pageNo=0beginset@pageNo=1endend;withtempas(selectROW_NUMBER()over(orderbyp.PROJECT_ID) 阅读全文
posted @ 2013-02-03 16:48 Amity 阅读(122) 评论(0) 推荐(0) 编辑

sql--批量更新

摘要: 替换掉表中旧的projectid值declare@atable(oldnvarchar(20),newnvarchar(20))insertinto@avalues('1000066175','1000071422')insertinto@avalues('1000068732','1000071995')updatedbo.FORECASTsetPROJECT_ID=b.newfromFORECASTinnerjoin@a bonFORECAST.Project_Id=b.old 阅读全文
posted @ 2013-02-03 16:46 Amity 阅读(118) 评论(0) 推荐(0) 编辑

sql--找含有制定字符列的表

摘要: 在数据库中找到含有指定字符列的表selectdistincttab.namefromsys.columnscolleftjoinsys.tablestaboncol.object_id=tab.object_idwherecol.namelike'%district%'andtab.nameisnotnull 阅读全文
posted @ 2013-02-03 16:43 Amity 阅读(83) 评论(0) 推荐(0) 编辑

sql--转置

摘要: select*from(selecta.PROJECT_ID,a.REVENUE,a.FORECAST_MONTHfromFORECAST a)pPIVOT(SUM(REVENUE)FORFORECAST_MONTHIN([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12]))C 阅读全文
posted @ 2013-02-03 16:41 Amity 阅读(141) 评论(0) 推荐(0) 编辑

Jquery小记

摘要: 1前台获取dropdownlistvarcurrentChannels=$('#ddlCurrentChannel').find("option");for(vari=0;i<currentChannels.length;i++) {if(currentChannels[i].selected==true) {districtCode.val(currentChannels[i].value);}}<asp:DropDownListrunat="server"ID="ddlCurrentChannel"Wi 阅读全文
posted @ 2013-02-03 16:37 Amity 阅读(147) 评论(0) 推荐(0) 编辑