摘要: string StypeId = SubsidiesCategory.SelectedValue.ToString(); --得到数据源 DataTable dt = TmBf.GetBType(Convert.ToInt32(StypeId)); string expression = "Status= '1'"; --定义一个空的DataTable DataTable newdt = new DataTable(); --克隆dt 的表结构,使newdt 和dt 结构相同newdt = dt.Clone();--使用 select方法在数所源中查询 Da 阅读全文
posted @ 2011-04-02 09:31 张宏宇 阅读(454) 评论(0) 推荐(0) 编辑
摘要: 判断 临时表#tmp是否存在if(object_id('tempdb..#tmp') is not null)begindrop table #tmpend1)判断 表DepartmentInfo是否存在if object_id('DepartmentInfo') is null beginselect '不存在'endelsebegin select '存在'end 2)判断表'LC_Department是否存在if not exists (select * from sysobjects where [name] = 阅读全文
posted @ 2011-03-29 09:16 张宏宇 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 表单form的提交有两种方式,一种是get的方法,一种是post 的方法.看下面代码,理解ASP.NET Get和Post两种提交的区别: < form id="form1" method="get" runat="server"> < div>姓名字< asp:TextBox ID="name" runat="server">< /asp:TextBox>< br /> 你的网站< asp:TextBox ID="we 阅读全文
posted @ 2011-03-16 09:12 张宏宇 阅读(337) 评论(0) 推荐(0) 编辑
摘要: declare @Year varchar(10),@Month varchar(10)set @Year=Convert(varchar,DATEPART(year,CONVERT(DATETIME,'2011-02-15')))set @Month=Convert(varchar,DATEPART(month,CONVERT(DATETIME,'2011-02-15')))select (DAY(dateadd(dd,-1,DATEADD(m,1,cast(@Year as varchar(4)) + '-' + cast(@Month as 阅读全文
posted @ 2011-02-28 16:30 张宏宇 阅读(184) 评论(0) 推荐(0) 编辑
摘要: Date.prototype.isLeapYear判断闰年Date.prototype.Format日期格式化Date.prototype.DateAdd日期计算Date.prototype.DateDiff比较日期差Date.prototype.toString日期转字符串Date.prototype.toArray日期分割为数组Date.prototype.DatePart取日期的部分信息Date.prototype.MaxDayOfDate取日期所在月的最大天数Date.prototype.WeekNumOfYear判断日期所在年的第几周StringToDate字符串转日期型IsVali 阅读全文
posted @ 2011-02-25 09:56 张宏宇 阅读(407) 评论(0) 推荐(0) 编辑
摘要: CASE WHEN 条件1 THEN 结果1 WHEN 条件2 THEN 结果2 WHEN 条件3 THEN 结果3 WHEN 条件4 THEN 结果4......... WHEN 条件N THEN 结果N ELSE 结果XENDCase具有两种格式。简单Case函数和Case搜索函数。--简单Case函数CASE sex WHEN '1' THEN '男' WHEN '2' THEN '女'ELSE '其他' END--Case搜索函数CASE WHEN sex = '1' THEN '男' WHEN sex = '2' THEN '女'ELSE '其他' END例如:SELECT id, 阅读全文
posted @ 2011-01-13 15:34 张宏宇 阅读(355) 评论(0) 推荐(0) 编辑
摘要: inner join(等值连接) 只返回两个表中联结字段相等的行 left join(左联接) 返回包括左表中的所有记录和右表中联结字段相等的记录 right join(右联接) 返回包括右表中的所有记录和左表中联结字段相等的记录INNER JOIN 语法:INNER JOIN 连接两个数据表的用法:SELECT * FROM 表1 INNER JOIN 表2 ON 表1.字段号=表2.字段号INNER JOIN 连接三个数据表的用法:SELECT * FROM (表1 INNER JOIN 表2 ON 表1.字段号=表2.字段号) INNER JOIN 表3 ON 表1.字段号=表3.字段号 阅读全文
posted @ 2011-01-13 13:28 张宏宇 阅读(239) 评论(0) 推荐(0) 编辑
摘要: &lt;sessionState mode="[Off|InProc|StateServer|SQLServer|Custom]" timeout="number of minutes" cookieName="session identifier cookie name" cookieless= "[true|false|AutoDetect|UseCookies|UseUri|UseDeviceProfile]" regenerateExpiredSessionId="[True|False 阅读全文
posted @ 2011-01-04 09:12 张宏宇 阅读(434) 评论(0) 推荐(0) 编辑
摘要: [AttributeUsage(AttributeTargets.Property, AllowMultiple = true, Inherited = true)]public class UserControlRenderingPropertyAttribute : Attribute{ string _key; public string Key { get { return _key; }... 阅读全文
posted @ 2010-11-06 10:42 张宏宇 阅读(313) 评论(0) 推荐(0) 编辑
摘要: //异常处理 public static bool GeException(string strMessage, string strName) { string time = System.DateTime.Now.ToString(); string strPathName = System.DateTime.Now.ToShortDateString() + "_" + strName + ... 阅读全文
posted @ 2010-10-27 11:58 张宏宇 阅读(339) 评论(0) 推荐(1) 编辑