自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(41)
  • 资源 (1)
  • 收藏
  • 关注

原创 RSA 不可逆加解密简类

// 调用string tmpPriKey, tmpPubKey;            RsaHelper.GetPriPubKey(out tmpPriKey, out tmpPubKey);            string content = "这是im 223~! #苛sdkfj23";            string inString = RsaHelper.RsaEncrypt...

2018-03-21 13:47:23 860

原创 sqlserver 中查看一个库中有多少表是有数据的

declare @table table (rows int,tablename nvarchar(100));declare @sql NVARCHAR(MAX)declare @rows int;insert into @tableselect ROW_NUMBER() over (order by name),name from sysobjects where    xtype = 'u'...

2018-02-14 14:19:58 3475

原创 CTE 递归

with cte(id) as(select 1union all select id + 1 from cte where id )select * from cte

2017-11-28 13:51:32 263

原创 mysql 一行转多列

/*drop table tbl_name;create table tbl_name (ID int ,mSize varchar(100));insert into tbl_name values (1,'tiny,small,big');insert into tbl_name values (2,'small,medium');insert into tbl_name

2016-02-18 09:40:28 3401

原创 ToDictionary test

public class Program    {        public static void Main()        {            List stulist = GetList();            //// 如果有多个grand 是一样的,直接出错            var dic1 = stulist.ToDictionary(m =

2015-04-30 10:17:35 578

转载 【转】SQL SERVER 查看SQL语句IO,时间,索引消耗

1.查看SQL语句IO消耗set statistics io on     select * from dbo.jx_order where order_time>'2011-04-12 12:49:57.580' set statistics io off   2.查看SQL语句时间消耗set statistics time on 

2015-02-17 15:03:53 636

转载 2000 动态 行列转换

if object_id('tb')is not null drop table tbgocreate table tb(姓名 varchar(10),课程 varchar(10),分数 int)insert into tb values('张三','语文',74)insert into tb values('张三','数学',83)insert into tb values(

2013-01-11 15:53:42 386

翻译 兔子

if Exists(select * from sysobjects where id = object_id('calrabbit'))begindrop function dbo.calrabbit endgocreate function dbo.calrabbit(@i int,@month int)returns  intasbeginif (@i

2013-01-11 15:48:33 250

翻译 猴子

猴子第一天摘下若干个桃子,当即吃了一半,还不过瘾,又多吃了一个,第二天早上又将剩下的桃子吃掉一半,又多吃了一个,以后每天早上都吃了前一天剩下的一半零一个,到第十天早上,再想吃时,见只剩下一个桃子了,求第一天一个摘了多少个桃子if Exists(select * from sysobjects where id = object_id('calpeaches'))begindrop fu

2013-01-11 15:48:05 363

原创 一个连续数字

--100次递归with cte1 as(select 1 i),cte3 as(select i from cte1 union all select i+1 i from cte3 where i )select * from cte3--spt_value,只到2047select number+1 from master..spt

2013-01-11 15:46:45 317

转载 百万插入

/*****************************一个方法******************************/ ---判断Nums 表是否存在,存在即将其删除   IF OBJECT_ID('dbo.Nums') IS NOT NULL       DROP TABLE dbo.Nums;   GO   ---重新创建表   CREATE TABLE d

2013-01-11 15:42:26 360

原创 一列转一行

/*表tbcol 11aacc想要的结果s1,s2,s3 --显示字段名11,aa,cc --数据结果*//***************临时表解决方案****************************************************************************************/-- 创建数据if Exists(selec

2013-01-11 15:39:56 371

转载 sp_who_lock

use mastergocreate procedure sp_who_lockasbegindeclare @spid int,@bl int, @intTransactionCountOnEntry int, @intRowcount int, @intCountProperties int, @intCounter

2012-12-27 16:09:45 1573

转载 找出SQL中的死锁进程

select a.resource_type, case a.resource_typewhen 'RID' then '行锁(表没有聚集索引表)'when 'KEY' then '行锁(表有聚集索引表)'when 'Page' then '数据页锁'when 'EXTEnt' then '连续8个页面集合锁'when 'Hobt' then '堆或平衡树锁(表没有聚集索引

2012-12-26 14:51:16 673

转载 SQLServer找出执行慢的SQL语句

SELECT(total_elapsed_time / execution_count)/1000 N'平均时间ms',total_elapsed_time/1000 N'总花费时间ms',total_worker_time/1000 N'所用的CPU总时间ms',total_physical_reads N'物理读取总次数',total_logical_reads/execution_

2012-12-24 11:42:44 8004

原创 执行动态SQL,并返回一个值

declare @recordCount intdeclare @sql nvarchar(max)set @sql = 'select @count = count(*) from table'exec sp_executesql @sql,N'@count int out',@recordCount outselect @recordCount

2012-08-06 16:17:38 722

转载 SQL 中的正则 查询

语法格式:PATINDEX ( '%pattern%' , expression ) 返回pattern字符串在表达式expression里第一次出现的位置,起始值从1开始算。pattern字符串在expression表达式里没找就返回0,对所有有效的文本和字符串就是有效的数据类型。描述一下此函数的具体用法:1. PATINDEX ( '%p

2012-08-02 17:08:42 5298

原创 模糊查询 按字数多少排序

declare @key nvarchar(20)set @key = '打印机 ibm a'declare @return nvarchar(100)declare @sql nvarchar(max)set @sql = ''if charindex(' ',@key) > 0begin while charindex(' ',@key) > 0 begin

2012-07-15 00:08:50 1915

转载 SQL Server DbLink

Exec sp_droplinkedsrvlogin LinkServer,Null --若存在先刪除Exec sp_dropserver LinkServerEXEC sp_addlinkedserver@server= 'LinkServer',--被訪問的服務器別名@srvproduct= '',@provider= 'SQLOLEDB',@datasrc= '192.168.0

2012-07-04 14:47:39 571

原创 MSSQL 行列转换

--普通版行列转换create table tb(姓名 varchar(10) , 课程 varchar(10) , 分数 int) insert into tb values('张三' , '语文' , 74) insert into tb values('张三' , '数学' , 83) insert into tb values('张三' , '物理' , 93) insert i

2012-06-21 18:21:44 501

原创 sql 中outer apply 和XML 并用

create table a (id int,tag varchar(100))create table b(id int,description nvarchar(100))goinsert into a select 1,'1,2,3' union allselect 2,'1,3' union allselect 3,'2,3'goinsert into b

2012-06-18 20:50:41 2170

原创 关于一行转一列

;with cte as(select '1' id , cast('2012-6-18 10:00' as datetime) gpstime union allselect '2',cast('2012-6-18 10:30' as datetime) union allselect '3',cast('2012-6-19 11:40' as datetime) union all

2012-06-18 20:48:19 412

原创 今天偶尔看到一题,做了一下

今天偶尔看到一题,网址如下:http://topic.csdn.net/t/20061023/11/5101874.html感觉两位的回答是正确的,但总感觉不是很爽,花了点时间,整理了下with cte as(select 1 mo,'收' me,1 nu union allselect 1,'收',2 union allselect 1,'付',2 uni

2012-05-17 23:09:42 366

原创 sql 2000 实现partition by rownumber功能

declare @a table(id nvarchar(10),num int)insert into @aselect '000019',1 union allselect '000019',0 union allselect '000019',0 union allselect '000019',0 union allselect '000020',0 union a

2012-05-17 16:05:52 875

原创 sql 补全空缺部分

with cte as(select '000019' CardId, cast('2012-5-15 0:00' as datetime) DataData, cast('2012-5-15 7:40' as datetime) DataTime,88 MachAddr union allselect '000019' ,'2012-5-15 0:00' ,'2012-5-15 13

2012-05-17 14:28:31 1305

原创 SQL 中的尖括号">"自动转成>,SQL递归简单写法

在写一句SQL的时候,发现有时SQL会自动把> 转成>代码如下:if object_id('t_001') >0 drop table t_001create table t_001 (id int ,val varchar(100),nid int)insert into t_001 select 0,'我',1 union select 1,'爱',2 union

2011-12-26 21:11:31 7396 2

原创 根据条件,隐藏或显示gridview中的按钮或其他控件,

protected void Bind() { CompInfo ci = (CompInfo)Session["coi"]; Complinkappl cla = new Complinkappl(); IList iclai = cla.Selsonly(" cpacompid = " + ci.

2009-03-20 21:52:00 4735

原创 sql 2000 中根据一个大类,查出所有小类在一起显示

create table infor(age int,telnum varchar(10))insert into infor values (23,887907)insert into infor values (23,807005)insert into infor values (20,123456)insert into infor values (21,21343)ins

2008-12-31 12:58:00 1370

原创 在 gridview 外查找 gridview中某个 textbox

 GridViewRow row = null;Control cmdControl = e.CommandSource as Control;row = cmdControl.NamingContainer as GridViewRow;string nownum = ((TextBox)row.Cells[3].FindControl("TxtNum")).Text.ToString();

2008-09-22 16:28:00 554

原创 查找repeater headertemplate 中的Literal dropdownlist

//下拉dorpdownlist时protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)        {            DropDownList ddl = null;            foreach (RepeaterItem item in Repeater1.Controls)

2008-09-22 16:27:00 692

转载 C# 函数大全(转)

 1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 int 月=currentTime.Month; 1.4 取当前日 int 日=curr

2008-01-15 15:52:00 1237

原创 在用户控件中常用到的,图片,背景图,相对链接出错问题,用ResolveUrl

其实很简单,就多加了一点点东西">登陆 ResolveUrl---转载ResolveUrl:我的站点名字叫http://net_boy:801/下面有一个/Images目录 放置图片的用户控件我放置在/Controls目录下我的一个用户控件叫 TitleSearch.ascx加入我的标题图片是/Images下的一个叫TitleSearch.gif的图片当这种

2007-12-07 13:46:00 603

原创 asp.net C# 一个方法返回多个结果

举个简单的例子,现在你有两个label,在一个方法中都能取到,你是不是要写两次?其实不用,有很多办法可以得到结果,比如返回一个数组,一个泛型,和其他的方法都可以得到这里介绍的是用一个方法,写个out就可以得到,个人认为是比较简单的和实用的一种方法一个方法返回两个值protected void Page_Load(object sender, EventArgs e)    ...{    

2007-11-15 16:56:00 4152 1

原创 SQL 中decimal 各位数的详细解释

参考MSND网址:http://msdn2.microsoft.com/zh-cn/library/5a10hy4y.aspx比如,一个deciaml,整数位3,小数位2,那么它的各项值如下:size参数的长度。 precision要将 Value 解析为的小数点左右两侧的总位数。 scale要将 Value 解析为的总小数位数。size = 3+2 = 5scale =

2007-11-01 15:00:00 1428

原创 用函数获得一个类型下所有的数据,并用逗号隔开,显示出来

create table infor(age int,telnum varchar(10))insert into infor values (23,887907)insert into infor values (23,807005)insert into infor values (20,123456)insert into infor values (21,21343)i

2007-11-01 12:31:00 740

原创 根据一个ID,找出它最上级的ID的函数,适用于有parentid的树形表结构

create function dbo.gettypeid(@a int)--传进来 一个typeid,得到这个typeid的最上级的typeid--select dbo.gettypeid(11609)returns varchar(8000)asbegindeclare @result intdeclare @cal intset set @cal = (select typeparent

2007-11-01 12:24:00 1421

原创 取一个大类下的所有小类的函数

create function dbo.getalltypeidbytypeid(@typeid int)---传进来一个typeid,列出这个typeid下面的所有的typeid--select dbo.getalltypeidbytypeid(10608)returns varchar(8000)asbegindeclare @result varchar(8000)set @result

2007-11-01 12:21:00 543

原创 通用游标写法

declare @basisname varchar (10)set @basisname = 底片格式declare @basissortid int    DECLARE    mycursor    CURSOR    local    FOR    --定义游标       select sortid from tsort where sortid between 87 and 9

2007-11-01 12:19:00 621

原创 asp.net动态生成按钮,点击按钮执行相关操作

1。先在页面上放个panelasp:Panel ID="Pnlshow1" runat="server" Height="20px" Width="600">                              asp:Panel>2。生成按钮Salontype salontype = new Salontype();            for (int i = 

2007-11-01 12:16:00 1783

原创 GRIDVIEW中RowCommand取第几行的方法(C#)

protected void GVProd_RowCommand(object sender, GridViewCommandEventArgs e)  {if (e.CommandName == "down")            {                ////因为这里e.CommandArgument已经

2007-11-01 11:58:00 2498

EmitMapper

EmitMapper映射效率比较高,最大限度地减少了拆箱装箱操作和映射过程中的额外的调用。

2016-03-18

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除