Đang chuẩn bị liên kết để tải về tài liệu:
Professional ASP.NET 1.0 Special Edition- P44

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Professional ASP.NET 1.0 Special Edition- P44:Those of us who are Microsoft developers can't help but notice that .NET has received a fair amount of visibility over the last year or so. This is quite surprising considering that for most of this period, .NET has been in its early infancy and beta versions. I can't remember any unreleased product that has caused this much interest among developers. And that's really an important point, because ignoring all the hype and press, .NET really is a product for developers, providing a great foundation for building all types of applications | sqlAdapter1.Fill products products return products public DataSet GetProductCategories SqlConnection myConnection new SqlConnection m_ConnectionString SqlDataAdapter sqlAdapterl new SqlDataAdapter SELECT DISTINCT ProductType FROM Products myConnection DataSet products new DataSet sqlAdapter1.Fill products products return products This class has four methods including the constructor ProductsDB - Initializes the class with a data source string. GetProduct - Returns a dataset containing details for a single product. GetProducts - Returns a dataset containing the details for all products in a specified category. GetProductCategories - Returns a dataset containing the list of product categories. The first three lines of the component declare the namespaces we are using using System using System.Data using System.Data.SqlClient All of our class files have these lines and they indicate that we are using the standard system namespace the namespaces for ADO.NET and the SQL Server-specific parts of ADO.NET System.Data.SqlClient . We use the SQL Server-specific elements of ADO.NET because they provide high performance SQL Server access using TDS Tabular Data Stream via the classes SqlConnection and SqlDataAdapter. If we needed to support a different back-end database we could recode our classes to use the OleDbConnection and OleDbDataAdapter classes which perform database access through OLEDB. These classes were discussed in Chapter 8. One important point to note about all of the ADO.NET code in the business object is that it does not contain any exception handlers. It is therefore up to the code that uses these classes to catch exceptions like SqlException which can be thrown if any error occurs when performing the data access such as the existence of duplicate rows and so on We haven t included any exception handling in our ASP.NET pages to keep them terse but the basic format is shown here try someObject.SomeMethodUsingAdoDotNet catch SqlException e if e.Number 2627 .

TÀI LIỆU LIÊN QUAN
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.