摘要: //将序列化成Json格式后日期(毫秒数)转成日期格式[/Date(1539100800000)/] function changeDateFormat(cellval) { var date = new Date(parseInt(cellval.replace("/Date(", "").rep 阅读全文
posted @ 2018-10-23 20:12 Mr靳先生 阅读(527) 评论(0) 推荐(0) 编辑
摘要: 自定义函数--把年龄大于传过来的参数的数据的条数返回create function FUN_GetUser(@UserAge int)returns int as begin declare @result int set @result = (select count(1) from UserIn 阅读全文
posted @ 2018-10-17 15:10 Mr靳先生 阅读(911) 评论(0) 推荐(0) 编辑
摘要: sql server事务begin try begin transaction --开始事务 update UserInfo set UserName='你好' where UserId=2 update UserInfo set UserAge='你好' where UserId=3 commit 阅读全文
posted @ 2018-10-17 14:52 Mr靳先生 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 创建一个游标,然后遍历userinfo表的所有数据,打印用户id和用户名--定义游标,让游标指向sql查询结果declare demoCursor Cursor for select userName,userId,userAge from userInfo --打开游标open demoCurso 阅读全文
posted @ 2018-10-17 14:08 Mr靳先生 阅读(2293) 评论(0) 推荐(0) 编辑
摘要: 1.使用局部临时表来调整自增长列select * from #newtemp from grade --相当于备份truncate table grade--删除数据insert into grade select classname from #newtemp 2.使用全局临时表来调整自增长列se 阅读全文
posted @ 2018-10-17 13:43 Mr靳先生 阅读(1481) 评论(0) 推荐(0) 编辑
摘要: 1.基本的存储过程 (1).查询所有学员的信息if exists(select * from sysobjects where name='usp_getAllstudent')drop proc usp_getAllstudentgocreate procedure usp_getAllstude 阅读全文
posted @ 2018-10-17 12:36 Mr靳先生 阅读(9700) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 文件缓存 /// </summary> protected void SetFileCache() { //获取文件 string filePath = Request.MapPath("File.txt"); if(Cache["fileContent"]==n 阅读全文
posted @ 2018-10-15 20:49 Mr靳先生 阅读(618) 评论(0) 推荐(0) 编辑
摘要: <%@ OutputCache Duration="5" VaryByParam="*"%> 可以在aspx加上这句话, 则是将整个html页面缓存。 1.Duration 默认是秒 2.VaryByParam指参数 一个参数id,两个参数id;a 一般写*多个参数 参数名称必须和地址栏的参数一致 阅读全文
posted @ 2018-10-15 17:12 Mr靳先生 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 1.Cache与Session的区别每个用户都有自己单独的Session对象但是放在Cache中的数据是大家共享的 protected void SetCache() { //判断缓存是否为空 if (Cache["UserInfo"] == null) { Bll.UserInfoBll user 阅读全文
posted @ 2018-10-15 17:07 Mr靳先生 阅读(846) 评论(0) 推荐(0) 编辑
摘要: SELECT DISTINCT [列名] ,STUFF( ( SELECT ','+[列名] FROM [表名] WHERE [根据哪一列合并的列名]= A.列名 FOR XML PATH('') ) ,1,1,'' )AS 合并的别名 FROM [表名] AS 表的别名(A) 阅读全文
posted @ 2018-10-11 15:41 Mr靳先生 阅读(3172) 评论(0) 推荐(0) 编辑