05 2010 档案
摘要:var collection = (function () { var keys = [], values = []; return { get: function (key) { var at = keys.indexOf(key); if (at >= 0) { return values[at]; } }, set: function (key, value) { var at = keys.indexOf(key); if (at = 0) { keys.splice(at, 1); values.splice(at, 1); } } };}());这个类相当于定义了一个静态集合
阅读全文
摘要:追加:row_number, rank, dese_rank, ntile1. row_number: 为查询出来的每一行记录生成一个序号。SELECT row_number() OVER(ORDER BY field) AS row_nFROM tablename;分页查询:with t_towtableas (select row_number over(order by field1) as row_number from tb)select * from t_rowtable where row_number > 1 and row_number > 4 order by
阅读全文
摘要:将从WebService得到数据并将xml转化成Dataset显示出来XmlDataDocument xd = new XmlDataDocument();DataSet ds = new DataSet();StringBuilder xmlStr = new StringBuilder(ServiceA.GetInfo(StrSearch).OuterXml);xd.loadXml(Xml.Str.toString());ds.readXml(new XmlNodeReader(xd));DataGrid1.DataSource = ds.Tables['list'].De
阅读全文
摘要:SQL常用函数:1. ASCII():返回字符串最左端字符的ASCII码。2. CHAR():将ASCII转换成字符。(0~255)3. LOWER()和UPPER()。4. STR():把数值型数据转换为字符型数据 SRT([,length[,]])LTRIM()把字符串头部空格去掉,RTRIM()把字符串尾空格去掉。取子串函数:1. LEFT(, length):返回char左起length个字符。2. RIGHT(, length):返回char右起length个字符。3. SUBSTRING(, , length):返回chars左边第position个字符起length个字符部分。字
阅读全文
摘要:视图SET NOCOUNT ON;SET Northwind;GOIF OBJECT_ID('dbo.ViewName') IS NOT NULL DROP VIEW dbo.ViewName;GOCREATE VIEW dbo.ViewnameASSELECT * FROM customer AS CWHERE EXISTS (SELECT * FROM dbo.Orders AS O WHERE O.CustomerID = C.Customerid);GO**************************我是分割线**************************IF
阅读全文
摘要:接口与类的区别:1. 不允许使用访问修饰符(public, private, protected或internal),所有接口都必须是公共的。2. 接口成员不能包含代码体。3. 接口不能定义字段成员。4. 接口成员不能使用关键字static, virtual, abstract或sealed(封闭的)来定义。5. 类型定义成员是禁止的。这点不明白隐藏基类成员,用关键字new来定义它们(显示隐藏)override重写父类中的方法virtual用来定义虚方法,用来被重写。调用重写或隐藏基类方法:base.parentMethod();this.childMethod();嵌套类型定义,调用:MyC
阅读全文