博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2010年12月23日

摘要: http://www.cnblogs.com/happyhippy/archive/2010/01/27/1657552.htmlLinq to Sql : 三种事务处理方式 Linq to SQL支持三种事务处理模型:显式本地事务、显式可分发事务、隐式事务。(from MSDN: 事务 (LINQ to SQL))。MSDN中描述得相对比较粗狂,下面就结合实例来对此进行阐述。 0. 测试环境OSWindows Server 2008 Enterprise + sp1IDEVisual Studio 2008, .net framework 3.5 + SP1DBSQL Server 200 阅读全文

posted @ 2010-12-23 11:38 ☆Keep★Moving☆ 阅读(226) 评论(0) 推荐(0) 编辑

2010年12月10日

摘要: 转地址:http://www.cnblogs.com/firstyi/archive/2007/10/11/921116.htmlIBatis.Net是一个比较易用的ORM框架,使用起来较为方便、灵活。在此记录我学习的过程,作为自己的一个总结。1、IBatis.Net学习笔记一:开篇 2、IBatis.Net学习笔记二:下载、编译、运行NPetShop 3、IBatis.Net学习笔记三:两种常用的DAO 4、IBatis.Net学习笔记四:数据库的缓存模式 5、IBatis.Net学习笔记五:常用的查询方式 6、IBatis.Net学习笔记六:再谈查询 7、IBatis.Net学习笔记七:日 阅读全文

posted @ 2010-12-10 00:36 ☆Keep★Moving☆ 阅读(332) 评论(0) 推荐(0) 编辑

摘要: http://wenku.baidu.com/view/97b96628915f804d2b16c17e.html 阅读全文

posted @ 2010-12-10 00:19 ☆Keep★Moving☆ 阅读(510) 评论(0) 推荐(0) 编辑

2010年12月9日

摘要: 看过IBatis在Java下简单的实现所以写个.net下IBatis最简单的实现,下面我来介绍下我的做法。 需要引入Castle.DynamicProxy.dll、IBatisNet.Common.dll、IBatisNet.DataAccess.dll和IBatisNet.DataMapper.dll四个DLL。 首先是需要一个测试的用的数据库(Test)下的一张表(Table1)有两个字段:col1,col2,还有一个和数据库对应的类Table1,代码如下: public class Table1 { private string _col1; private string _col2; 阅读全文

posted @ 2010-12-09 23:48 ☆Keep★Moving☆ 阅读(513) 评论(0) 推荐(0) 编辑

2010年12月8日

摘要: 用MyXls生成Excel报表(C#) MyXLS 是一个快速和简单的读写 Excel 文件的 .NET 组件,可用在 ASP.NET 网站和 .NET 应用程序中,无需安装 Excel 程序,支持 Excel 97 以及以后的版本。 目前MyXls已经实现了单元格(cell)的格式设置,包括文本颜色、文本大小、字体、单位格边框、底色、列宽、行高,合并单元格,多个sheet页等功能。以下是MyXLS组件的一些用法:1.创建一个Excel文档:XlsDocument xls = new XlsDocument();2.创建一个WorkSheet:Worksheet ws = xls.Workb 阅读全文

posted @ 2010-12-08 09:05 ☆Keep★Moving☆ 阅读(795) 评论(1) 推荐(1) 编辑

2010年12月7日

摘要: function DiffDays(date1, date2) { // Parameters : // date1 : Date object // date2 : Date object // Returns : Number of days between date1 and date2var iDate2Time = date2.getTime();var iDate1Time = date1.getTime();var iReturn = (iDate2Time-iDate1Time); // /(1000*60*60*24);return (iReturn); } 阅读全文

posted @ 2010-12-07 23:53 ☆Keep★Moving☆ 阅读(215) 评论(0) 推荐(0) 编辑

摘要: sContent為字符串,sPattern為要替換的單引號,sReplexp為替換成雙引號function ReplaceString(sContent, sPattern, sReplexp){ var arrSingle; var sReturnString; // split 的工作原理:"as'asdf'asd'''f".split(sPattern)// 轉換後會變為[as], [asdf], [asd], [], [], [f] if(sContent.length 0) { if(sContent.indexOf(sPattern) =0) { arrSingle = s 阅读全文

posted @ 2010-12-07 23:52 ☆Keep★Moving☆ 阅读(145) 评论(0) 推荐(0) 编辑

摘要: function StringToDate(sDate) { // Parameters : // sDate : A string with the format "mm/dd/yyyy" or "mm/dd/yyyy hh:mm:ss" // Returns : a Date object if (sDate ==""){ sDate="01/01/2040";}var ArDateTime = sDate.split (" "); var ArDate = ArDateTime[0]; var splitDate = ArDate.split ("/"); var nDay = ToN 阅读全文

posted @ 2010-12-07 23:52 ☆Keep★Moving☆ 阅读(283) 评论(0) 推荐(0) 编辑

摘要: 方法一:private void Button13_Click(object sender, System.EventArgs e) { this.Datagrid4.Visible=true; Response.Clear(); Response.Buffer= true; Response.Charset="GB2312"; Response.AppendHeader("Content-Disposition","attachment;filename=File1.doc"); Response.ContentEncoding=System.Text.Encoding.GetEncodin 阅读全文

posted @ 2010-12-07 23:50 ☆Keep★Moving☆ 阅读(194) 评论(0) 推荐(0) 编辑

摘要: 1. 创建一个新excel的application:application exc = new application();if (exc == null) {console.writeline("error: excel couldn't be started");return 0;}2. 让这个工程可见:exc.set_visible(0, true);3. 获取workbooks集合:workbooks workbooks = exc.workbooks;4. 加入新的workbook:_workbook workbook = workbooks.add(xlwbatemplate.xl 阅读全文

posted @ 2010-12-07 23:50 ☆Keep★Moving☆ 阅读(2278) 评论(0) 推荐(0) 编辑