TAILIEUCHUNG - Understanding the SqlConnection Class

Understanding the SqlConnection Class You use an object of the SqlConnection class to connect to a SQL Server database, and this object handles the communication between the database and your C# program. | Understanding the SqlConnection Class You use an object of the SqlConnection class to connect to a SQL Server database and this object handles the communication between the database and your C program. Note Although the SqlConnection class is specific to SQL Server many of the properties methods and events in this class are the same as those for the OleDbConnection and OdbcConnection classes. If a property or method is specific to SqlConnection it says so in the Description column of the tables shown in this section. You can look up the exact properties methods and events for a specific class using the .NET online reference. You saw how to do that in Chapter 1 Introduction to Database Programming with . Table shows some of the SqlConnection properties. Table SqlConnection PROPERTIES PROPERTY TYPE DESCRIPTION ConnectionString string Gets or sets the string used to open a database. ConnectionTimeout int Gets the number of seconds to wait while trying to establish a connection to a database. The default is 15 seconds. Database string Gets the name of the current database or the database to be used once the connection to the database is made . DataSource string Gets the name of the database server. PacketSize int Gets the size in bytes of network packets used to communicate with SQL Server. This property applies only to the SqlConnection class. The default is 8 192 bytes. ServerVersion string Gets a string containing the version of SQL Server. State ConnectionState Gets the current state of the connection Broken Closed Connecting Executing Fetching or Open. These states are covered later in the Getting the State of a Connection section. WorkstationId string Gets a string that identifies the client computer that is connected to SQL Server. This property applies only to the SqlConnection class. Table shows some of the SqlConnection methods. Table SqlConnection METHODS METHOD RETURN TYPE DESCRIPTION BeginTransaction SqlTransaction Overloaded. Begins

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.