摘要: with temp as(select *From tb_order where Auditing=2 and AuditingTime>='2013-04-01' and Flag=2)select *from temp where EbayAccountID=21 相当于临时表 temp 分析器可以智能提示 临时表却不能。临时表select * into #temp From tb_order where Auditing=2 and AuditingTime>='2013-04-01' and Flag=2select * From #temp 阅读全文
posted @ 2013-04-24 11:25 放哨De老鼠 阅读(855) 评论(0) 推荐(1) 编辑
摘要: a. 一个月的第一天SELECT DATEADD(mm, DATEDIFF(mm,0,getdate()), 0)b. 本周的星期一SELECT DATEADD(wk, DATEDIFF(wk,0,getdate()), 0)c. 一年的第一天SELECT DATEADD(yy, DATEDIFF(yy,0,getdate()), 0)d. 季度的第一天SELECT DATEADD(qq, DATEDIFF(qq,0,getdate()), 0)e. 上个月的最后一天SELECT dateadd(ms,-3,DATEADD(mm, DATEDIFF(mm,0,getdate()), 0))f. 阅读全文
posted @ 2013-04-23 14:06 放哨De老鼠 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 有时我们知道了两个DataTable1和DataTable2,我们希望将它们合并为一个新的DataTable(下面的例子中命名为了newDataTable),这就分为两种情况:DataTable1和DataTable2结构相同、DataTable1和DataTable2结构不同,下面分别介绍怎么进行合并。一、DataTable1和DataTable2结构相同的情况,结构相同我们只需要把两者的数据罗列到一块就可以了首先初始化相同结构DataTable(测试用的) void InitDataTable1(DataTable dt) { dt.Columns... 阅读全文
posted @ 2013-04-23 12:13 放哨De老鼠 阅读(331) 评论(0) 推荐(0) 编辑
摘要: private static ArrayList DataTableToArrayList(DataTable dt){ArrayList array = new ArrayList();for (int i = 0; i < dt.Rows.Count; i++){DataRow row = dt.Rows[i];Hashtable Ht= new Hashtable();for (int j = 0; j < dt.Columns.Count; j++){object cellValue = row[j];if (cellValue.GetType() == typeof(DB 阅读全文
posted @ 2013-04-19 11:40 放哨De老鼠 阅读(380) 评论(0) 推荐(0) 编辑
摘要: SELECT 网站名称, 姓名 ,SUM(产品数)as 产品数from(SELECT f.Url as 网站名称, e.Name AS 姓名,a.OrderNumber ,SUM(b.Quality)as 产品数FROM tb_order(nolock) as aleft join tb_OrderList as b on b.OrderID=a.IDleft join tb_WebSitePromotion as c on c.WebSiteInfoID=a.WebSiteInfoID and c.SpreadTypeID=2 and c.StartDate0 and len(isnull( 阅读全文
posted @ 2013-04-18 17:44 放哨De老鼠 阅读(434) 评论(0) 推荐(0) 编辑
摘要: SELECT *FROM tb_User ORDER BY ID DescOFFSET 1000 ROWSFETCH NEXT 20 ROWS ONLY; 阅读全文
posted @ 2013-04-15 12:18 放哨De老鼠 阅读(365) 评论(3) 推荐(0) 编辑
摘要: 第一种方法:select *from ( select Url,case when Month=01 then '1月' when Month=02 then '2月' when Month=03 then '3月' when Month=04 then '4月' when Month=05 then '5月' when Month=06 then '6月' when Month=07 then '7月' when Month=08 then '8月' when Mo 阅读全文
posted @ 2013-04-15 09:52 放哨De老鼠 阅读(424) 评论(0) 推荐(0) 编辑
摘要: DataTable dt = new DataTable(); System.Data.DataTable ExcelTable; DataSet dst = new DataSet(); string strconn = ""; if (this.currFileExtension==".xls")//这样判断不太好 暂时未找出判断Excel版本的解决办法 { strconn = "... 阅读全文
posted @ 2013-04-11 13:47 放哨De老鼠 阅读(257) 评论(0) 推荐(0) 编辑
摘要: js对文字进行编码涉及3个函数:escape,encodeURI,encodeURIComponent,相应3个解码函数:unescape,decodeURI,decodeURIComponent1、 传递参数时需要使用encodeURIComponent,这样组合的url才不会被#等特殊字符截断。 例如:2、 进行url跳转时可以整体使用encodeURI例如:Location.href=encodeURI("http://cang.baidu.com/do/s?word=百度&ct=21");3、 js使用数据时可以使用es... 阅读全文
posted @ 2013-03-26 11:31 放哨De老鼠 阅读(204) 评论(0) 推荐(0) 编辑
摘要: declare @Name intdeclare @NameS int select @Name= Namefrom INSERTED//获取更新后的Name select @NameS= Namefrom Deleted//获取更新前的Nameif(update(字段名))//这样写 当更新这个字段的时候才会执行下面的 新增同样有效begin//触发执行end 阅读全文
posted @ 2013-03-26 11:21 放哨De老鼠 阅读(369) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2013-03-06 10:39 放哨De老鼠 阅读(38) 评论(0) 推荐(0) 编辑
摘要: //非空验证function IsNotEmpty(str) { if (str.replace(/(^[\s]*)|([\s]*$)/g, "") == "" || str.replace(/(^[\s]*)|([\s]*$)/g, "") == "不能为空.") return false; else return true;}//整型验证function IsInt(str) { if (str == "") return true; if (/^(\-?)(\d+)$/.test(str) 阅读全文
posted @ 2013-03-01 10:40 放哨De老鼠 阅读(151) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.IO;using System.Runtime.InteropServices;using Microsoft.Win32;using System.Diagnostics;using System.Data;using System.Data.OleDb;public partial class Defa 阅读全文
posted @ 2013-02-27 12:13 放哨De老鼠 阅读(287) 评论(0) 推荐(0) 编辑
摘要: private void ToExcel(System.Data.DataTable dt_Data, string fileName) { fileName = fileName + ".xls"; try { HttpResponse resp; resp = Page.Response; resp.Buffer = true; resp.ClearContent(); ... 阅读全文
posted @ 2013-02-25 17:59 放哨De老鼠 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://www.cnblogs.com/wifi/archive/2013/02/19/2916565.htmlvs2005针对datatable已经有封装好的去重复方法:1 //去掉重复行2 DataView dv = table.DefaultView;3 table = dv.ToTable(true, new string[] { "name", "code" });4 5 此时table 就只有name、code无重复的两行了,如果还需要id值则6 7 table = dv.ToTable(true, new string[] 阅读全文
posted @ 2013-02-19 11:49 放哨De老鼠 阅读(262) 评论(0) 推荐(0) 编辑
摘要: private bool FileExists(string fileUrl) { bool result = false;//下载结果 WebResponse response = null; try { WebRequest req = WebRequest.Create(fileUrl); response = req.GetResponse(); result = response == null... 阅读全文
posted @ 2013-02-01 14:59 放哨De老鼠 阅读(210) 评论(0) 推荐(0) 编辑
摘要: if (!Page.ClientScript.IsClientScriptIncludeRegistered(GetType(), "OC")) { Page.ClientScript.RegisterClientScriptInclude(GetType(), "OC", ResolveClientUrl("../Announcement/Announcement.js")); } 阅读全文
posted @ 2012-12-27 09:24 放哨De老鼠 阅读(160) 评论(0) 推荐(0) 编辑
摘要: #DDD 只针对当前打开窗口或者存储过程有效 在存储过程中 执行完自动删除临时表select b.TransactionID into #DDD from tb_test as a inner join tb_order as b on a.TransactionID=b.TransactionID where a.Status in('Uncleared','Under Review','Held') and b.InTime>GETDATE()-4 ... 阅读全文
posted @ 2012-12-01 15:08 放哨De老鼠 阅读(332) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.IO;namespace WindowsFormsApplication1{ public partial class Form1 : Form { string FileName = string.Empty; DataTable dtExcelData; 阅读全文
posted @ 2012-12-01 15:02 放哨De老鼠 阅读(2500) 评论(0) 推荐(0) 编辑
摘要: string str="abc\"";Regex.Replace(str,@"[\""]+", ""); 阅读全文
posted @ 2012-11-28 10:33 放哨De老鼠 阅读(816) 评论(0) 推荐(0) 编辑