C#
夏令
test
展开
-
SQLServer修改表字段时进行表连接
update A set A.XXX='XXXX'from TableA Ainner join TableB B on B.XX=A.XXwhere XXXXX原创 2016-03-11 14:45:22 · 333 阅读 · 0 评论 -
SQLServer XXX IS NOT NULL
SQLServer中不能使用像Java和C#中的 XXX!=null 这种用法,使用上面的用法返回值永远是False False False 正确的用法应该是--> XXX is not null------切记原创 2016-03-11 14:48:36 · 1502 阅读 · 0 评论 -
SQLServer2008 字符串函数一览表
/* 字符串函数 (PS.索引都从1开始计算)*/ /* 指定字符(或字符串)A、字符串B、起始索引。获得A在B中的索引值。*/select Charindex('d','abcdefg',0) --4select Charindex('bc','abcdefg',0) --2/* 以整数返回两个字符表达式的SOUNDEX值之差 */select Difference('big','bit原创 2016-03-11 14:48:28 · 332 阅读 · 0 评论 -
SQLServer 使用变量动态行转列
drop table #testcreate table #test( id int identity(1,1) primary key, bizDate varchar(50), type varchar(50), qty float)insert into #testselect '20110501','A',20.5 union allselect '201105原创 2016-03-11 14:48:12 · 638 阅读 · 0 评论 -
SQLServer 表连接时使用top 1 去除重复数据
left join SM_SOLine soline on soline.SO=so.ID and soline.DocLineNo=(select MAX(DocLineNo) from SM_SOLine where so=so.ID) create table #test8( id int, name varchar(50))drop table #test9cr原创 2016-03-11 14:48:03 · 1751 阅读 · 0 评论 -
[转]解决C# WinForm 中 VSHOST.EXE 程序不关闭的问题
右击“解决方案”--属性-调试栏-启用调试器部分-“启用Visual studio宿主进程”不勾选原创 2016-03-11 14:46:15 · 323 阅读 · 0 评论 -
[转]C# ListView 单击标题实现排序(在转载的基础上有所完善)
using System;using System.Collections;using System.Windows.Forms;//在转载的基础上有所完善namespace TDRFactory{ /// /// 对ListView点击列标题自动排序功能 /// public class ListViewHelper {原创 2016-03-11 14:46:06 · 239 阅读 · 0 评论 -
[转]C#使用Window图片查看器打开图片
//建立新的系统进程 System.Diagnostics.Process process = new System.Diagnostics.Process(); //设置文件名,此处为图片的真实路径+文件名 process.StartInfo.FileName = picName;原创 2016-03-11 14:45:58 · 3571 阅读 · 0 评论 -
WinForm上传文件,下载文件
上传文件:使用OpenFileDialog控件选择文件,具体代码示例: private void btnUpLoadPic_Click(object sender, EventArgs e) { //文件类型过滤 openFileDialog1.Filter = "图像文件(*.jpg,*.bmp,*.gif)|*.j原创 2016-03-11 14:45:50 · 1613 阅读 · 0 评论 -
SQLServer2008 在where条件中使用CASE WHEN
create table #temp( id int identity(1,1), name varchar(20), startYear int, startMonth int)insert into #tempselect 'z','2010','12' union allselect 'e','2011','11' union allselect 'a','201原创 2016-03-11 14:49:25 · 10049 阅读 · 0 评论