博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 25 下一页

2014年1月6日

摘要: 验证电话号码的主要代码如下: public bool IsTelephone(string str_telephone) { return System.Text.RegularExpressions.Regex.IsMatch(str_telephone, @"^(\d{3,4}-)?\d{6,8 阅读全文

posted @ 2014-01-06 14:06 米粒3 阅读(441) 评论(0) 推荐(0) 编辑

摘要: //如果文本中可以为空的为NO,文本中内容不为空 if (input.nullable == "no" || !isnull(input.value)) { //文本中值的类型 switch (input.datatype) { //数字 case "number": //isnumber是否是数字 阅读全文

posted @ 2014-01-06 14:03 米粒3 阅读(1649) 评论(0) 推荐(0) 编辑

2013年12月24日

摘要: 说正事简而言之,在Cookie的时候有三个过程,分别是“写入,读取,删除”。任何伟大之作都是有基本的东西构成的,而Cookie的运用也不例外。写入: 1 //创建一个HttpCookie对象 2 HttpCookie cookie = new HttpCookie("RON"); 3 //设定此cookies值 4 cookie.Value = "我叫小魏"; 5 //设定cookie的生命周期,在这里定义为三分钟 6 DateTime dtNow = DateTime.Now; 7 TimeS... 阅读全文

posted @ 2013-12-24 11:17 米粒3 阅读(170) 评论(0) 推荐(0) 编辑

2013年12月12日

摘要: 取得某月和上个月第一天和最后一天的方法[c-sharp]view plaincopy//////取得某月的第一天//////要取得月份第一天的时间///privateDateTimeFirstDayOfMonth(DateTimedatetime){returndatetime.AddDays(1-datetime.Day);}/**///////取得某月的最后一天//////要取得月份最后一天的时间///privateDateTimeLastDayOfMonth(DateTimedatetime)returndatetime.AddDays(1-datetime.Day).AddMonths 阅读全文

posted @ 2013-12-12 11:15 米粒3 阅读(2623) 评论(0) 推荐(0) 编辑

2013年11月15日

摘要: 昨晚无意中发现一个有趣的jQuery插件.tmpl(),其文档在这里。官方解释对该插件的说明:将匹配的第一个元素作为模板,render指定的数据,签名如下: .tmpl([data,][options]) .tmpl([data,][options]) .tmpl([data,][options]) 阅读全文

posted @ 2013-11-15 16:20 米粒3 阅读(202) 评论(0) 推荐(0) 编辑

2013年11月1日

摘要: 方法一 分割例:通过SQL Server存储过程传送数组参数删除多条记录eg. ID 值为'1,2,3' 以下存储过程就是删除表中id号为1,2,3的记录:CREATE PROCEDURE DeleteNews @ID nvarchar(500)as DECLARE @PointerPrev int DECLARE @PointerCurr int DECLARE @TId int Set @PointerPrev=1 while (@PointerPrev 0) Begin set @TId=cast(SUBSTRING(@ID,@PointerPrev,@PointerCu 阅读全文

posted @ 2013-11-01 15:25 米粒3 阅读(349) 评论(0) 推荐(0) 编辑

2013年10月30日

摘要: -TOPn实现的通用分页存储过程(邹建)CREATEPROCsp_PageView@tbnamesysname,--要分页显示的表名@FieldKeynvarchar(1000),--用于定位记录的主键(惟一键)字段,可以是逗号分隔的多个字段@PageCurrentint=1,--要显示的页码@PageSizeint=10,--每页的大小(记录数)@FieldShownvarchar(1000)='',--以逗号分隔的要显示的字段列表,如果不指定,则显示所有字段@FieldOrdernvarchar(1000)='',--以逗号分隔的排序字段列表,可以指定在字段 阅读全文

posted @ 2013-10-30 18:35 米粒3 阅读(198) 评论(0) 推荐(0) 编辑

摘要: 在开发过程中,很多时候要把结果集存放到临时表中,常用的方法有两种。一. SELECT INTO1. 使用select into会自动生成临时表,不需要事先创建12 select * into #temp from sysobjectsselect * from #temp2. 如果当前会话中,已存在同名的临时表1 select * into #temp from sysobjects再次运行,则会报错提示:数据库中已存在名为'%1!' 的对象。www.it165.netMsg 2714, Level16, State 6, Line 2There is alreadyan ob 阅读全文

posted @ 2013-10-30 15:31 米粒3 阅读(347) 评论(0) 推荐(0) 编辑

摘要: 存储过程表的循环以下以SQL Server 2000中的NorthWind数据库中的Customers表为例,用 临时表 + While循环 的方法, 对Customers表中的CompanyName列进行遍历create table #temp(id int identity(1,1),customer nvarchar(50))declare @customer nvarchar(50)declare @nintdeclare @rowsintselect @n=1insert #temp(customer) select distinct companyname from custome 阅读全文

posted @ 2013-10-30 15:11 米粒3 阅读(689) 评论(0) 推荐(0) 编辑

摘要: --判断数据库是否存在IF EXISTS (SELECT * FROM MASTER..sysdatabases WHERE NAME = '库名') PRINT 'exists 'else PRINT 'not exists'-- 判断要创建的表名是否存在IF EXISTS (Select * From sysObjects Where Name ='表名' And Type In ('S','U'))PRINT 'exists'ELSEPRINT 'not exists& 阅读全文

posted @ 2013-10-30 14:43 米粒3 阅读(209) 评论(0) 推荐(0) 编辑

上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 25 下一页