摘要:
"ado.net 2.0 技术内幕SqlConnection类专门为与MicrosoftSQLServer数据库进行通信而设计的类,代表与数据库之间的连接,还用作创建查询和事务的起始点。例子:string strConn;strConn = @"Data Source=.\SQLExpress;" + "Initial Catalog=Northwind; Intergrated Security=True;"SqlConnection cn = new SqlConnection(strConn);打开SqlConnection对象:cn.O 阅读全文
posted @ 2011-03-19 15:32
ndxsdhy
阅读(1335)
评论(0)
推荐(0)
摘要:
"ado.net 2.0 技术内幕强烈建议在Using代码块内所有可能的位置创建短期生存对象。Using块确保及时在Using块内波发生未处理异常时,也会在该代码块的末尾调用Dispose方法。例子:string strConn, strSQL;strconn = @"Data Source=.\SQLExpress;" + "Initial Catalog = Northwind;Integrated Security=True;";strSQL = "SELECT CustomerID, CompanyName FROM Cust 阅读全文
posted @ 2011-03-19 14:37
ndxsdhy
阅读(434)
评论(0)
推荐(0)

浙公网安备 33010602011771号