随笔分类 -  .NET

正则表达式之日期类型(匹配闰年)
摘要:验证日期格式为YYYY-MM-DD的正则表达式为:(([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9... 阅读全文
posted @ 2007-08-30 16:56 张伦 阅读(683) 评论(0) 推荐(0)
C#sql查询导出为excel文件,并最终释放excel资源。
摘要:public bool ExcelOut(string filename,string sql1,string sql2){try{// Start a new workbook in Excel.m_objExcel = new Excel.Application();m_objBooks = (Excel.Workbooks)m_objExcel.Workbooks;m_objBook = (... 阅读全文
posted @ 2005-11-22 15:51 张伦 阅读(2302) 评论(0) 推荐(0)
水晶报表ReportViewer之“创建控件错误”
摘要:1、打开工程,右键点击工程,添加引用。2、点击浏览,到program files\crystal Decisions\crystal report9,在下面搜索(包括子目录)'CrystalDecisions.VSDesigner.dll' 然后确定。3、如果弹出提示,选择“是”。4、拖一个ReportViewer到视图上,应该不会出现错误了 阅读全文
posted @ 2005-11-22 15:47 张伦 阅读(1001) 评论(0) 推荐(0)
ASP.NET:创建对话框
摘要:.aspx写在中 .cs中: Message.value = "Hello world!"; 阅读全文
posted @ 2005-03-03 18:54 张伦 阅读(509) 评论(0) 推荐(0)
ASP.NET: excel加两列导入到sqlserver
摘要:OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+filename+";UserID=Admin;Password=;Extended properties=Excel 8.0"); conn.Open(); DataTable d... 阅读全文
posted @ 2005-01-14 18:56 张伦 阅读(790) 评论(0) 推荐(0)