DavidYun

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

2011年9月1日

摘要: SqlConnection con =new SqlConnection(ConnectionDb.conStr);//获取数据库连接 con.Open();//打开连接 SqlTransaction sqltra = con.BeginTransaction();//开始事务 SqlCommand cmd =new SqlCommand();//实例化 cmd.Connection = con;//获取数据连接 cmd.Transaction = sqltra;//,在执行SQL时,try { ... 阅读全文
posted @ 2011-09-01 10:42 David.Yun 阅读(1805) 评论(0) 推荐(0) 编辑

2011年8月18日

摘要: --查找子节点 createtable Info ( ID char(3), PID char(3), [Name]varchar(20) ) insertinto Info select'001',null,'山东省' unionallselect'002','001','烟台市' unionallselect'004','002','招远市' unionallselect'003','001','青岛市' union 阅读全文
posted @ 2011-08-18 13:03 David.Yun 阅读(2903) 评论(0) 推荐(1) 编辑

摘要: createtable tb(id varchar(3) , pid varchar(3) , name varchar(10))insertinto tb values('001' , null , '广东省')insertinto tb values('002' , '001' , '广州市')insertinto tb values('003' , '001' , '深圳市')insertinto tb values('004' , '0 阅读全文
posted @ 2011-08-18 12:57 David.Yun 阅读(5506) 评论(0) 推荐(0) 编辑