摘要:.NET FCL中工厂方法的实例:枚举器 IEnumerable是工厂原型 IEnumerator是产品原型 List, ArrayList这些类都是建立产品的具体类,都实现了IEnumerable接口,有一个GetEnumerator()的方法返回IEnumerator 实现一个简单的工厂方法 using System; using System.Colle...
阅读全文
随笔分类 - C#编程语言
语言的我们手中的武器,必须精通它,才能取胜!
摘要:.NET FCL中工厂方法的实例:枚举器 IEnumerable是工厂原型 IEnumerator是产品原型 List, ArrayList这些类都是建立产品的具体类,都实现了IEnumerable接口,有一个GetEnumerator()的方法返回IEnumerator 实现一个简单的工厂方法 using System; using System.Colle...
阅读全文
摘要:代码示例: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.OracleClient; using System.Data; namespace EffectiveCsharp { interface IMessage ...
阅读全文
摘要:废话少说,看程序就明白了。 using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { /**//// /// C#转换操作符号学习 /// public sealed class MyCls { ...
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class MyCls { public int X { get; ...
阅读全文
摘要:C#代码: SqlConnection conn = new SqlConnection("Data Source=192.168.1.200;Initial Catalog=PBCRM;Persist Security Info=True;User ID=sa;Password=123456"); conn.Open(); SqlTrans...
阅读全文
摘要:http://www.javaeye.com/forums/board/Java
阅读全文
摘要:ExecuteReader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction. 同一个connection,在update的command上启动了一个transaction,后面一个查询的command,没...
阅读全文
摘要:CommandBehavior.CloseConnection的作用,先看一下面的代码: SqlDataReader sqlread = sqlcom.ExecuteReader(CommandBehavior.CloseConnection);//这里设置了SqlDataReader的CommandBehavior为CloseConnection return sqlread; 说明...
阅读全文
摘要:开发环境:Win XP SP2, VS2005, Office 2003. 报错环境:Win 2003 SP2,.NET2.0框架,无Office. 问题发现:ASP.NET程序用模板的方法操作Excel,Server上没有安装Office,用OLEDB操作Excel时,只支持低版本Excel的格式,但我用的模板是我机子上建立的,Excel 2003的格式,所以报错 解决方案:将Excel模...
阅读全文
摘要:VS 2008 中文"试用版"变"正式版"方法 2008-02-19 16:07 Visual Studio 2008简体中文(官方90天版)变永久正式版的方法 方法一: 升级正式版的方法是把Setupsetup.sdb文件中的[Product ...
阅读全文
摘要:今天在VS2005中,用 TableAdapter.Update更新access数据库 在 dataset中已经更改了,但是下次启动时在数据库中就是没变 今天自己为这个问题困扰了好久,后来上网上找资料, 找到一个网友写的 用access数据库时,你的 解决方案资源管理器 数据库属性下有个 复制大输出目录属性,如果是始终复制,那么虽然你改写了当前使用的数据库,但下次运行的时候还是要被覆盖掉,感...
阅读全文
|