日常方法

1.C#.NET 字符串转数组,数组转字符串

             string str = "1,2,3,4,5,6,7";
            string[] strArray = str.Split(','); //字符串转数组
            str = string.Empty;
            str = string.Join(",", strArray);//数组转成字符串

2.c# 三种取整方法 向上取整 向下取整 四舍五入

            Math.Round:四舍六入五取整

            Math.Ceiling:向上取整,只要有小数都加1

           Math.Floor:向下取整,总是舍去小数

3.SqlServer 查询死锁,杀死死锁进程

       

-- 查询死锁
select    
    request_session_id spid,   
    OBJECT_NAME(resource_associated_entity_id) tableName    
from    
    sys.dm_tran_locks   
where    
    resource_type='OBJECT'
--杀死死锁进程
kill 354 

4、查询在一个个表中有另一个表中没有的数据

select   UserId,UserName   from   Users 
where UserId NOT in(select UserId from  PxbUser  where Users.UserId=PxbUser.UserId and PxbId=1)



select   UserId,UserName   from   Users  where 
(select count(1) as num from PxbUser where PxbUser.UserId = Users.UserId and PxbUser.PxbId=1) = 0   --效率更高
原文地址:https://www.cnblogs.com/sharing1986687846/p/8421940.html