摘要: 在 SQL查询语句中,case 语句的两种写法(SqlServer 2005 下测试通过):[代码] 阅读全文
posted @ 2010-06-09 13:16 Darren.Xiang 阅读(971) 评论(0) 推荐(0) 编辑
摘要: 常用数据处理函数:1. 常用文本处理函数函数说明CharIndex()返回字符串中指定字符的位置Left()返回字符串左边的字符Len()返回字符串的长度Lower()将字符串转换为小写LTrim()去掉字符串左边的空格Replace()用其他特殊字符替换字符串中的字符Right()返回字符串右边的字符RTrim()去掉字符串右边的空格Soundex()返回字符串的SOUNDEX值Str()将数值... 阅读全文
posted @ 2010-01-28 11:37 Darren.Xiang 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 主键:可以将多个列设为主键,但是所有列的值的组合必须唯一(单个列的值可以不唯一)。常用系统存储过程:SP_DATABASES; //获取可用的数据库列表USE [数据库名]; //使用当前库SP_TABLES; //获取当前数据库内全部数据表列表SP_TABLES NULL,DBO,[数据库名],"'TABLE'"; //获取当前数据库内指定条件的数据表列表SP_SERVER_INFO; //显示... 阅读全文
posted @ 2010-01-25 16:59 Darren.Xiang 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 表名:d_ClientInfo语句作用:取出第100-120条数据Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->SELECT*FROM(SELECTROW_NUMBER()OVER(ORDERBYClientIDASC)ASROWID,*FROMd_ClientInfo)AStmpTableWHEREROWIDBETWEEN100AND120此函数会为数据表重新编号并新建数据列ROWID,不需要的屏蔽掉就OK了。 阅读全文
posted @ 2010-01-07 16:33 Darren.Xiang 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->StringstrServerName="服务器名或IP";StringstrUserID="数据库用户名";StringstrPSW="数据库密码";DataTableDBNameTable=newDataTable();OleDbConnectionConnection=newOleDbConnection(String.Forma 阅读全文
posted @ 2009-04-13 11:30 Darren.Xiang 阅读(1213) 评论(0) 推荐(0) 编辑
摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->privatevoidform1_FormClosing(objectsender,FormClosingEventArgse){if(e.CloseReason==CloseReason.UserClosing){e.Cancel=true;this.Hide();TaskIcon.BalloonTipTitle="分诊系统";TaskIcon.BalloonTipText 阅读全文
posted @ 2009-03-04 16:35 Darren.Xiang 阅读(2842) 评论(0) 推荐(2) 编辑
摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->DataSetdx=newDataSet();dx.ReadXml(Application.ExecutablePath+".config",XmlReadMode.InferSchema);DataRow[]dtTmp=dx.Tables["setting"].Select("name='DepartName'");d 阅读全文
posted @ 2009-02-20 18:23 Darren.Xiang 阅读(1025) 评论(1) 推荐(0) 编辑