- 博客(78)
- 资源 (6)
- 收藏
- 关注
原创 分页的存储过程
1 创建分页的存储过程create proc GetPageList @pageIndex int , @pageSize int, @rowCount int outputasbegin set nocount on select @rowCount=count(*) from student select * from (select *,row_number()...
2020-03-28 22:37:09 233
原创 t-sql编程
t-sql编程:只能在sql server中使用,其他可能关键字不同-》变量 -》声明:declare 变量名 类型--变量名要求以 @ 开头 -》设置:set/select 变量名=值 -》输出:print/select 变量名declare @name nvarchar(10)set @name= '武大郎'print @name -》全局变量:...
2020-03-28 19:54:03 137
原创 数据透视
1 创建视图create View View_Student_Score as select stu.sName as StuName,score.sName as SubjectName,score.Score as ScoreValue from Student stuinner join ScoreInfo score on score.stuId=stu.sId2 执行视图查...
2020-03-28 17:32:06 227
原创 db-子查询
子查询关键字 = in exists in和exists是一样得,语法不同,大数据时候exists效率略高1.哪些班级里面有学生select * from class where cid in (select sClassId from Student)2 哪些班级里面有学生select * from Class where exists(select * from...
2020-03-28 16:43:20 166 1
原创 db-视图
视图一般是把关联查询进行封装,主要用来查询操作,其他尽量不要用视图1 创建视图create view View_Class_Student as select * from Class c inner join Student s on c.cId = s.sClassId2 使用视图select * from View_Class_Student...
2020-03-28 15:58:15 280
原创 linux shell获取文件名和路径
1. 获取文件名:basename#/bin/bashFile=/dir1/dir2/dir3/a.b.c.txt basename $File执行的结果为:a.b.c.txt若不想带后缀,则:#/bin/bashFile=/dir1/dir2/dir3/a.b.c.txt echo $(basename $File .txt)结果为:a.b....
2020-03-23 17:32:23 1570
原创 MD5
using System;using System.Collections.Generic;using System.Linq;using System.Security.Cryptography;using System.Text;using System.Threading.Tasks;namespace t1_UserLogin{ public static par...
2020-03-23 11:10:47 168
原创 Sql server Profiler的使用
1 在sql server中选择工具,SQL Server Profiler2,执行访问数据库的代码,在这里既可以看到具体执行的什么,对于参数化的sql,实际执行的是一个存储过程...
2020-03-23 10:54:05 158
原创 简单的sql注入
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Linq;using System.Text;using System.T...
2020-03-23 10:21:37 106
原创 连接池
如果使用了连接池,当close,dispose时候,并不真正的关闭连接,而是将连接对象放入连接池中,下次再新建时候,其实没有新建,只是从连接池中拿出来,而如果不启用连接池,close,dispose则是真正的关闭连接,再重新建立则耗费更多的时间,如果不close,直接new的话则是真正的重新建立对象,因为不close,表示当前连接对象还在用using System;using System...
2020-03-23 09:56:20 89
原创 利用事件在窗体间传递数据(观察者模式)
1 定义委托using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace t1_Form{ //定义了一个方法的格式,是一个类型,命名规则与类一样 //public delegate ...
2020-03-23 09:48:30 195
原创 表快速备份
-》向未有表备份:select 列名 into 备份表名 from 源表名-》说明:备份表可以不存在,会新建表,表的结构完成一致,但是不包含约束 如果想只包含结构不包含数据,可以加个top 0-》向已有表备份:insert into 备份表名 select 列名 from 源表名...
2020-03-21 20:09:52 231
原创 查询sql
--别名、全部列、部分列select UserInfo.UserName name,UserInfo.UserPwd pwdfrom UserInfo--top nselect * from StudentInfoselect top 1 *from StudentInfoselect top 2 percent *from StudentInfo--排序,asc表示升,d...
2020-03-21 11:48:28 1500
原创 约束对应得脚本
主键:primary key 非空:not null 惟一:unique 默认:default() 检查:check() 外键:foreign key(列名) references 表名(列名)
2020-03-21 09:35:11 124
原创 创建数据库和表得脚本
--drop database MySchoolcreate database MySchoolon(--括号一定是圆括号name='MySchool_data',--数据库名称filename='d:\MySchool_data.mdf',--物理文件名size=5mb,--初始大小maxsize=10mb,--最大大小filegrowth=15% --主文件增长率)lo...
2020-03-21 08:40:59 451
原创 添加唯一约束 检查约束 外键约束
1.添加唯一约束 新建表时候,选择右键->索引/键2.类型选择唯一键即可2.添加检查约束,选择列,右键->CHECK约束3.点击添加4.点击表达式右边得按钮,输入约束得表达式即可...
2020-03-21 08:17:06 823
原创 插件
1 界面2 window代码using EditPlus;using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.IO;using System.Linq;using Sy...
2020-03-20 16:45:01 91
原创 反射
using System;using System.Collections.Generic;using System.Linq;using System.Reflection;using System.Text;using System.Threading.Tasks;namespace ConsoleApp1{ class Program { s...
2020-03-20 15:14:57 118
原创 linq to xml-写xml
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Xml.Linq;namespace _10写入xml文件{ class Program { static void Main(string[] args) ...
2020-03-19 17:23:16 87
原创 linq to xml-读xml
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Xml.Linq;namespace _09读取xml文件{ class Program { static void Main(string[] args) ...
2020-03-19 17:21:07 132
原创 .net IL 指令速查
Add 将两个值相加并将结果推送到计算堆栈上。 Add.Ovf 将两个整数相加,执行溢出检查,并且将结果推送到计算堆栈上。 Add.Ovf.Un 将两个无符号整数值相加,执行溢出检查,并且将结果推送到计算堆栈上。 And 计算两个值的按位“与”并将结果推送到计算堆栈上。 Arglist 返回指向当前方法的参数列表的非托管指针。 Beq 如果两...
2020-03-19 16:35:59 176
原创 ctrl+enter发送消息
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta...
2020-03-19 16:35:26 374
原创 键盘控制div移动
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><styl...
2020-03-19 16:35:18 115
原创 跟随鼠标移动得div
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><styl...
2020-03-19 16:35:05 83
原创 取消事件冒泡
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><styl...
2020-03-19 16:34:55 109
原创 事件冒泡
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html onclick="alert('html');" xmlns="http://www.w3.org/1999/xhtml"&...
2020-03-18 20:03:19 104
转载 event-或可以返回真得值
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta...
2020-03-18 20:01:07 118
原创 document是什么
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title></title> <script> alert(document.childNodes[1].tagName) </script> </head&g...
2020-03-18 19:53:31 303
原创 回到顶端
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><styl...
2020-03-18 19:41:07 112
原创 侧边栏
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><styl...
2020-03-18 19:34:49 207
原创 location
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta...
2020-03-18 19:25:19 378
转载 userAgent
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta...
2020-03-18 19:23:24 349
原创 运行代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta...
2020-03-18 19:18:56 552
原创 用class选元素
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><styl...
2020-03-18 19:18:14 177
原创 使用offsetLeft实现滚动
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title></title> <style> #dv{ width: 100px; height: 100px; background-color: #ccc; ...
2020-03-18 19:16:40 190
转载 js-splice
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><styl...
2020-03-17 22:15:39 262
原创 js排序
sort只能排序字符串,如果要排数字需要添加匿名函数作为参数<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999...
2020-03-17 22:08:18 81
原创 自定义得css函数
obj.currentStyle只能在IE里面用<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml...
2020-03-17 21:50:34 1232
原创 延时提示框
<!DOCTYPE html><html> <head> <meta charset="utf-8"> <title></title> <style> #a{ } </style> <script> window.onload=funct...
2020-03-15 20:24:32 96
ASP.NET MVC 5高级编程 第5版(中文版带书签)
2018-07-09
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人