摘要: 一.WITH AS的含义WITH AS短语,也叫做子查询部分(subquery factoring),可以让你做很多事情,定义一个SQL片断,该SQL片断会被整个SQL语句所用到。有的时候,是为了让SQL语句的可读性更高些,也有可能是在UNION ALL的不同部分,作为提供数据的部分。特别对于UNI... 阅读全文
posted @ 2015-11-09 14:32 Twang 阅读(1298) 评论(0) 推荐(0)
摘要: Union因为要进行重复值扫描,所以效率低。如果合并没有刻意要删除重复行,那么就使用Union All两个要联合的SQL语句 字段个数必须一样,而且字段类型要“相容”(一致);如果我们需要将两个select语句的结果作为一个整体显示出来,我们就需要用到union或者union all关键字。unio... 阅读全文
posted @ 2015-11-09 14:18 Twang 阅读(219) 评论(0) 推荐(0)
摘要: 从此不再惧怕URI编码:JavaScript及C# URI编码详解混乱的URI编码 JavaScript中编码有三种方法:escape、encodeURI、encodeURIComponent C#中编码主要方法:HttpUtility.UrlEncode、Server.UrlEncode、Ur... 阅读全文
posted @ 2015-11-09 14:14 Twang 阅读(406) 评论(0) 推荐(0)
摘要: Server.UrlEncode、HttpUtility.UrlDecode的区别在对URL进行编码时,该用哪一个?这两都使用上有什么区别吗?测试:string file="文件上(传)篇.doc";string Server_UrlEncode=Server.UrlEncode(file);str... 阅读全文
posted @ 2015-11-03 16:32 Twang 阅读(374) 评论(0) 推荐(0)
摘要: 两种获取connectionString的方式 1. public static string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; <conne 阅读全文
posted @ 2015-10-14 21:26 Twang 阅读(6769) 评论(0) 推荐(1)
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Configuration;using System.Data;using System.Data.SqlCli... 阅读全文
posted @ 2015-10-07 21:47 Twang 阅读(400) 评论(0) 推荐(0)
摘要: 先来看一下默认的连接SQL Server数据库配置<connectionStrings> <add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=SSPI;AttachDBFi 阅读全文
posted @ 2015-10-03 11:26 Twang 阅读(602) 评论(0) 推荐(0)
摘要: --创建表:GOCREATE TABLE [dbo].[tb1]( [Id] [int] NOT NULL, [c1] [nvarchar](50) NULL, [c2] [datetime] NULL,CONSTRAINT [PK_Table1] PRIMARY KEY CLUSTERED( [I... 阅读全文
posted @ 2015-09-30 15:08 Twang 阅读(750) 评论(0) 推荐(0)
摘要: 一、 1、取字符串的前i个字符 (1)string str1=str.Substring(0,i); (2)string str1=str.Remove(i,str.Length-i); 2、去掉字符串的前i个字符 string str1=str.Remove(0,i); string str1=s 阅读全文
posted @ 2015-09-29 21:16 Twang 阅读(492) 评论(0) 推荐(0)
摘要: 本文较详细地介绍了C#的DateTime对象的使用方法.DateTime.Now.ToShortTimeString() DateTime dt = DateTime.Now; dt.ToString();//2005/11/5 13:21:25 dt.ToFileTime().ToString() 阅读全文
posted @ 2015-09-25 09:47 Twang 阅读(4905) 评论(0) 推荐(1)