SqlConnection对象的需要是使你能够让其它的ADO.NET代码使用数据库。其它的ADO.NET对象,比如SqlCommand和SqlDataAdapter使用connection对象作为参数。在SqlConnection的生命周期中发生的操作顺序如下:
- Instantiate the SqlConnection.
- Open the connection.
- Pass the connection to other ADO.NET objects.
- Perform data base operations with the other ADO.NET objects.
- Close the connection.
1. 实例化SqlConnection
2. 打开连接
3. 传递连接给其它的ADO.NET对象
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >> |