2006年11月23日
摘要: using System.Data; // Use ADO.NET namespaceusing System.Data.SqlClient; SqlConnection thisConnection = new SqlConnection( @"Data Source=GY; Initial Catalog=northwind;uid=sa;pa... 阅读全文
posted @ 2006-11-23 14:46 風清雲淡 阅读(1007) 评论(1) 推荐(0)
摘要: 在 C# 中使用 "Using" 语句 对于 C# 程序员来说,确保始终关闭 Connection 和 DataReader 对象的一个方便的方法就是使用 using 语句。using 语句在离开自己的作用范围时,会自动调用被“使用”的对象的 Dispose。例如: //C#string connString = "Data Source=localhost;Integrated Securi... 阅读全文
posted @ 2006-11-23 11:58 風清雲淡 阅读(189) 评论(0) 推荐(0)