程序笔记
随心而记
摘要: declare @str nvarchar(250)set @str=N'汉字转拼音123测试abc'declare @re nvarchar(max)declare @i int,@ilen int,@splitchr nvarchar(1)select @splitchr=' ' --两个拼音之间的分隔符(目的是为了通用性考虑),@i=0,@ilen=len(@str),@re=N''whil... 阅读全文
posted @ 2009-09-14 16:00 蝎 阅读(692) 评论(0) 推荐(0) 编辑
摘要: Function PrevInstance() As Boolean Try Dim PROC As Process Dim intProCount As Integer = 0 PROC = Diagnostics.Process.GetCurrentProcess If UBound(Diagnostics.Process.GetProcessesByName(PROC.ProcessName... 阅读全文
posted @ 2009-08-26 15:19 蝎 阅读(852) 评论(0) 推荐(0) 编辑
摘要: Private Function CopyDataTableTOServer() As Boolean Dim strSQL As String Dim bcp As System.Data.SqlClient.SqlBulkCopy = New System.Data.SqlClient.SqlBulkCopy(Sql连接字符串) Dim dtHTNSIJF As DataTable strSQ... 阅读全文
posted @ 2009-07-31 19:01 蝎 阅读(290) 评论(0) 推荐(0) 编辑
摘要: SELECT[name],case [type] when 'U' then 'TB' when 'V' then 'VE' when 'P' then 'SP' when 'IF' then 'FC' end as 型,[create_date]as 作成時間,[modify_date] as 更新時間FROMsys.objectsWhere([type]='U' or [type] = 'V'... 阅读全文
posted @ 2009-06-26 09:43 蝎 阅读(542) 评论(0) 推荐(0) 编辑
摘要: createtabletest (nunumber);insertintotestvalues(1);insertintotestvalues(1);insertintotestvalues(1);insertintotestvalues(2);insertintotestvalues(3);insertintotestvalues(4);-----------------------------... 阅读全文
posted @ 2009-06-25 13:59 蝎 阅读(1089) 评论(0) 推荐(0) 编辑
摘要: WITH TT AS(SELECT *,rownum = row_number() over(partition by [分组字段] order by newid()) FROM 表名)SELECT * FROM TTwhere rownum = 1 阅读全文
posted @ 2009-06-25 11:52 蝎 阅读(1187) 评论(0) 推荐(0) 编辑
摘要: SET LANGUAGE US_ENGLISHSELECT GETDATE() AS NowTime,REPLACE(ISNULL(LEFT(CONVERT(VARCHAR(30),GETDATE(),7),6),''),' ','') AS NewTime----------------------------------------------------------------------C... 阅读全文
posted @ 2009-06-16 10:44 蝎 阅读(1307) 评论(0) 推荐(0) 编辑
摘要: SELECT * FROM TB1 ORDER BY [name]id name------ ----------1 A 5 A 6 A 2 B 3 B 4 C (6 行処理されました)----------------------------------------------------------------------------select * from tb1 as tb2 where ... 阅读全文
posted @ 2009-06-05 13:52 蝎 阅读(679) 评论(0) 推荐(0) 编辑
摘要: CREATE TABLE [dbo].[TableTest]([id] [int] primary key,[name] [varchar](20) DEFAULT('') NOT NULL,[value] [int] DEFAULT(0) NOT NULL) insert TableTest values(1,'A','0')insert TableTest values(2,'A','0')i... 阅读全文
posted @ 2009-05-15 17:07 蝎 阅读(435) 评论(1) 推荐(0) 编辑
摘要: 引发textbox控件的KeyDown事件里加入如下代码:if (e.KeyCode == Keys.Enter) { e.SuppressKeyPress = true;//回车事件已经处理完不再响应了 } 阅读全文
posted @ 2009-04-20 11:27 蝎 阅读(883) 评论(0) 推荐(0) 编辑