TAILIEUCHUNG - Beginning C# 2005 Databases From Novice to Professional phần 3

Để khôi phục lại cơ sở dữ liệu Northwind, bạn nhấn phải chuột lên nút Northwind trong Object Explorer, hơn Nhiệm vụ nhấp chuột ® Restore ® Cơ sở dữ liệu Bạn sẽ thấy cửa sổ trong hình 2-17. 19. Click vào OK và bạn sẽ nhận được hộp tin nhắn trong hình 2-18. | CHAPTER 4 INTRODUCING 79 Table 4-3. Commonly Used OleDb Classes Class Description OleDbCommand Executes SQL queries statements or stored procedures OleDbConnection Represents a connection to an OLE DB data source OleDbDataAdapter Represents a bridge between a dataset and a data source OleDbDataReader Provides a forward-only read-only data stream of rows from a data source OleDbError Holds information on errors and warnings returned by the data source OleDbParameter Represents a command parameter OleDbTransaction Represents a SQL transaction Notice the similarity between the two data providers SqlClient and OleDb. The differences in their implementations are transparent and the user interface is fundamentally the same. The OLE DB data provider requires that an OLE DB provider be specified in the connection string. Table 4-4 describes some OLE DB providers. Table 4-4. Some OLE DB Providers Provider Description DB2OLEDB Microsoft OLE DB provider for DB2 SQLOLEDB Microsoft OLE DB provider for SQL Server Microsoft OLE DB provider for Access which uses the Jet engine MSDAORA Microsoft OLE DB provider for Oracle MSDASQL Microsoft OLE DB provider for ODBC Let s use the OLE DB data provider SQLOLEDB to access the Northwind database making a few straightforward changes to the code in Listing 4-1. Of course you d use the SQL Server data provider for real work since it s more efficient. Try It Out Creating a Simple Console Application Using the OLE DB Data Provider Let s access Northwind with OLE DB 1. In Solution Explorer add a new C console application project named OleDbProvider to the Chapter04 solution. Rename the file to . In Code Editor replace the generated code with the code in Listing 4-2 which shows the changes to Listing 4-1 in bold. 80 CHAPTER 4 INTRODUCING Listing 4-2. using System using using namespace Chapter04 class OleDbProvider static void

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.