随笔分类 - C#
摘要:<add key="ConnectionStringSQLite" value="data source=|path|DB/XXX.db;Version=3;" /> 数据库物理路径:D:/WebRoot/bin/DB/XXX.db 解决办法:修改连接字符串 修改后: <add key="Conne
阅读全文
摘要:开发语言C#,System.Data.SQLite.dll驱动。 SQLserver数据库转换为SQLite数据库时,日期类型默认转为DATETIME。 执行查询SQL语句,数据为空(查询不到数据时)报错【该字符串未被识别为有效的 DateTime 】。 解决办法:把DATETIME类型修改为TIM
阅读全文
摘要:
阅读全文
摘要:有些电脑报错,有些电脑正常。 环境:VS2010 WinForm程序, Office2007C#操作Excel时报错。错误:无法将类型为“System.__ComObject”的 COM 对象强制转换为接口类型“Microsoft.Office.Interop.Excel.Workbook”。此操作...
阅读全文
摘要:转载:http://blog.sina.com.cn/s/blog_555ea2470101831d.html做个记录。1.卸载OFFICE 使用工具 MicrosoftFixit,Windows Install CleanUp2.解决办法: 1) 依次点击开始,所有程序,附件,右键单击命令提示符,...
阅读全文
摘要:关键是不能换行,要加上begin ...sql... end; 每个SQL用;隔开,end后面必须加;以下是拷贝于:http://www.cnblogs.com/teamleader/archive/2007/05/31/765943.html有时我们需要一次性执行多条sql语句,而用来更新的sql是根据实际情况用代码拼出来的解决方案是把sql拼成下面这种形式:beginupdate TB_VG set seq = 1, vessel_id = 'Jin14', vessel_type = 'TRACK' where batch_number = '20
阅读全文
摘要:System.Web.UI.WebControls.DataGriddatagrid=newSystem.Web.UI.WebControls.DataGrid();datagrid.ID="excelGrid1";datagrid.DataSource=data;datagrid.DataBind();stringfilename="table.xls";filename=System.Web.HttpUtility.UrlEncode(System.Text.Encoding.UTF8.GetBytes(filename));//导出System.W
阅读全文
摘要:直接贴上代码 1usingSystem;2usingSystem.ComponentModel;3usingSystem.Globalization;4usingSystem.Runtime.InteropServices;5usingSystem.Windows.Forms;67namespaceSimpleControl8{9/*10*1.只能输入数字和小数点11*2.在最前面输入0无效12*3.只能输入一个小数点,输入小数点时检查是否已经存在小数点了,存在就把光标移到小数点的后面13*/14//[ToolboxBitmap(typeof(NumericTextBox),"Num
阅读全文
摘要:System.Windows.Forms.Help.ShowHelp(...);重载函数的参数在这里就不多说了。直接看例子吧。最简单的例子 System.Windows.Forms.Help.ShowHelp(this, Application.StartupPath + @"\abc.chm", "/12.htm");就会打开帮助文档abc.chm并且跳转到12.htm页面
阅读全文
摘要:第一步: 打开“我的电脑“,在地址栏输入 %systemroot%\Microsoft.NET\Framework
阅读全文
摘要:枚举定义的相关内容就不在此说了;这里说说枚举的常用操作枚举与符号、值的转换获取所有的符号名FlagsAttribute特性的使用对枚举组合(通过按位或符号“|”)运用switch定义一个枚举用作后面的例子enum EnumName{ Red = 1, Green, Blue = 4, White = 8, Black = 16}枚举与符号、值的转换EnumName en = EnumName.Green;//1.枚举转值int enValueInt = (int)en; // enValueInt 被赋值为 2string enValueStr = en.ToString("D&qu
阅读全文
摘要:假设三个表t_user , t_user_detail , t_log_info 记录都比较多(5000~1000)。select count(user_id),a.user_typefrom t_user ainner join t_user_detail b on a.user_id=b.user_idinner join t_log_info c on b.user_id=c.user_idwhere a.user_type=100 这样会比较慢。一个小小的改进速度会快很多。b.user_id 改成a.user_idselect count(user_id),a.user_typefro
阅读全文
摘要:protectedvoidPage_Load(objectsender,EventArgse){if(this.Request.Files.Count==0){return;}HttpPostedFilepostedFile=this.Request.Files[0];intContentLength=postedFile.ContentLength;if(ContentLength==0)return;byte[]bytes=newbyte[ContentLength];//把上传的文件中的XML文本读出到stringpostedFile.InputStream.Read(bytes,0,C
阅读全文
摘要:using System.IO;using iTextSharp.text;using iTextSharp.text.pdf;/// <summary> /// PDF合并 /// </summary> /// <param name="fileList">需要合并的PDF文件路径</param> /// <param name="outMe...
阅读全文
摘要:using System.IO;using iTextSharp.text;using iTextSharp.text.pdf;/// <summary> /// PDF加水印 /// </summary> /// <param name="inputfilepath">源PDF文件</param> /// <param name="o...
阅读全文
摘要:今天学会了怎么来用ildasm破解和用ilasm来重新编译(1)程序员用高级OO语言(C#,VB.Net,VC.Net,Cobol,Python..)编写代码,这些代码经过.Net 编译器(比如Visual Studio.Net),编译成统一的MSIL(Microsoft Intermediate Language)。NET应用程序是以MSIL的形式出现的,只有在程序执行的时候才通过即时编译器JI...
阅读全文
摘要:<html> <body> <table id=tableList border=1 width=100> <tr><td>1</td></tr> </table> <button onclick=addRow()>插入行</button> </body> <...
阅读全文
摘要:1. EXISTS的执行流程select * from t1 where exists ( select null from t2 where y = x )可以理解为: for x in ( select * from t1 ) loop if ( exists ( select null from t2 where y = x.x ) then OUTPUT THE RECORD end if...
阅读全文
摘要:出现这个错误的原因不详,但可能是因为安装了IE7.0,在VS2003.net中来调试C#写的ASP.net程序,启动时会出现这个错误,不能调试。一般用下面的方法可以解决:1:确认在“配置属性”中的“启用ASP.NET调试"为"True"2:确认你的"web.config"中的"debug=true"3:若你安装过Win2000 SP4后,则要在命令行执行"reg...
阅读全文

浙公网安备 33010602011771号