tailieunhanh - Murach’s ado net _4 database programming with vb 2010 phần 4
gạch đầu dòng chi tiết bất cứ điều gì là cần thiết để minh họa và tóm tắt các chủ đề, các trang còn lại cung cấp thêm lời giải thích và quan điểm khi cần thiết. Điều đó làm cho nó dễ dàng cho các nhà phát triển ở cấp độ nào để đọc lướt qua vật liệu mà chúng đã biết và tập trung vào những gì mới mẻ đối với họ. | Chapter 6 How to work with connections commands and data readers 201 Two constructors for the SqlConnection class New SqlConnection 0 New SqlConnection connectionstring Common properties and methods of the SqlConnection class Property Description Connectionstring Provides information for accessing a SQL Server database. Method Description Open Opens the connection using the specified connection string. Close 0 Closes the connection. Dispose 0 Releases all resources used by the connection. Common values used in the Connectionstring property Name Description Data Source Server The name of the instance of SQL Server you want to connect to. Initial Catalog Database The name of the database you want to access. Integrated Security Determines whether the connection is secure. Valid values are True False and SSPI. SSPI uses Windows integrated security and is equivalent to True. User ID The user ID that s used to log in to SQL Server. Password Pwd The password that s used to log in to SQL Server. Persist Security Info A Boolean value that determines whether sensitive information such as the password is returned as part of the connection. The default is False. Workstation ID The name of the workstation that s connecting to SQL Server. Code that creates opens and closes a SQL connection Dim connectionstring As string Data Source localhost sqlexpress Initial Catalog Payables Integrated Security True Dim connection As New SqlConnection 0 connectionstring 0 Another way to create a SqlConnection object Dim connection As New SqlConnectlon connectionstring A connection string for the Jet OLE DB provider Provlder Data Source C Databaaea Description You can set the Connectionstring property after you create a connection or as you create it by passing the string to the constructor of the connection class. The values you specify for the Connectionstring property depend on the type of .
đang nạp các trang xem trước