摘要: 方法一:利用字符串截取拆分数组字符串脚本Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/----=============================================--Author:<lx>--Createdate:<... 阅读全文
posted @ 2010-11-26 11:37 闭着眼睛想 阅读(4903) 评论(0) 推荐(0) 编辑
摘要: using System.IO;using System.Runtime.InteropServices;[DllImport("kernel32.dll")]public static extern IntPtr _lopen(string lpPathName, int iReadWrite);[DllImport("kernel32.dll")]public static extern bo... 阅读全文
posted @ 2010-11-25 16:26 闭着眼睛想 阅读(14451) 评论(0) 推荐(1) 编辑
摘要: SqlHelper类调用存储过程的方法有下面类似的两种类型:/// <param name="connectionString">A valid connection string for a SqlConnection</param>/// <param name="commandType">The CommandType (stored procedure,... 阅读全文
posted @ 2010-11-25 16:16 闭着眼睛想 阅读(4245) 评论(1) 推荐(1) 编辑
摘要: 1、先设定DataGridView显示的字段及样式 /// <summary> /// Add column to DataGridView /// </summary> private void DataGridViewSet() { DataGridViewTextBoxColumn column = new DataGridViewTextBoxColumn(); c... 阅读全文
posted @ 2010-11-25 15:36 闭着眼睛想 阅读(12790) 评论(0) 推荐(1) 编辑
摘要: 在VS2005|2008|2010中,经常会使用到ConfigurationSettings类来读取应用程序配置文件的信息,以获取数据库连接的字符串,但是,经常会出现如下的错误: 警告“System.Configuration.ConfigurationSettings.GetConfig(string)”已过时:“This method is obsolete... 阅读全文
posted @ 2010-11-25 15:31 闭着眼睛想 阅读(1503) 评论(0) 推荐(0) 编辑
摘要: 代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--///<summary>///数据库中与C#中的数据类型对照///</summary>///<paramname="type"></param>///&... 阅读全文
posted @ 2010-11-25 15:05 闭着眼睛想 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 1.编码string state=Server.UrlEncode(stateName.Text.Trim());Response.Redirect("aaa.aspx?state="+state+""); 2.解码(aaa.aspx)string state= Server.UrlDecode(Request.QueryString["state"].ToString());是GB2312编码的... 阅读全文
posted @ 2010-11-08 10:33 闭着眼睛想 阅读(9705) 评论(0) 推荐(0) 编辑
摘要: select getdate() 2004-09-12 11:06:08.177 举例如下: select CONVERT(varchar, getdate(), 120 ) 2004-09-12 11:06:08select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','') 2004... 阅读全文
posted @ 2010-10-11 09:52 闭着眼睛想 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 一、Xlsx files:[代码]"HDR=yes;"是说第一行是列名而不是数据。"HDR=No;"正好与前面的相反。把数据当做文本对待,使用这条连接当你想把所有的数据都当做文本对待时,覆盖Excel通常的猜测这列的数据类型。[代码]如果你想把列名也读到结果集中(使用“HDR=NO”尽管第一行是列名)并且列中的数据是数值型的,使用“IMEX=1”可必... 阅读全文
posted @ 2010-09-28 17:34 闭着眼睛想 阅读(355) 评论(0) 推荐(0) 编辑
摘要: 1、在Asp页面首部<head>加入 以下为引用的内容:Response.Buffer = True Response.ExpiresAbsolute = Now() - 1 Response.Expires = 0 Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "No-Cache"   2、在H... 阅读全文
posted @ 2010-06-30 11:29 闭着眼睛想 阅读(430) 评论(0) 推荐(0) 编辑