TAILIEUCHUNG - Beginning VB 2008 Databases From Novice to Professional phần 7

Tương tự như vậy, các nhà cung cấp dịch vụ truy cập dữ liệu Oracle Oracle trực tiếp. Lưu ý Tất cả các nhà cung cấp lớn DBMS hỗ trợ các nhà cung cấp dữ liệu của của họ. Chúng tôi sẽ dính vào SQL Server này cuốn sách, nhưng các loại tương tự của VB NET code. viết của nhà cung cấp. | Simpo PDF Merge and Split Unregistered Version - http CHAPTER 13 USING DATASETS AND DATA ADAPTERS 235 3. Make FilterSort the startup project and run it by pressing Ctrl F5. You should see the results in Figure 13-4. Figure 13-4. Filtering and sorting a data table How It Works You code and combine two queries for execution on the same connection query 1 Dim sqll As String select from customers query 2 Dim sql2 As String select from products _ where unitprice 10 combine queries Dim sql As String sql1 sql2 create connection Dim conn As SqlConnection New SqlConnection connstring You create a data adapter assigning to its SelectCommand property a command that encapsulates the query and connection for internal use by the data adapter s Fill method create data adapter Dim da As SqlDataAdapter New SqlDataAdapter New SqlCommand sql conn You then create and fill a dataset create and fill dataset Dim ds As DataSet New DataSet ds customers Simpo PDF Merge and Split Unregistered Version - http 236 CHAPTER 13 USING DATASETS AND DATA ADAPTERS Each query returns a separate result set and each result set is stored in a separate data table in the order in which the queries were specified . The first table is explicitly named customers the second is given the default name customers1. You get the data table collection from the dataset Tables property for ease of reference later get the data tables collection DataTableCollection dtc As part of displaying the first data table you declare two strings set display filter string fl country Germany set sort string srt companyname asc The first string is a filter expression that specifies row selection criteria. It s syntactically the same as a SQL WHERE clause predicate. You want only rows where the Country column equals Germany . The second string specifies your sort criteria and is syntactically the same as a SQL ORDER BY clause giving a data column name and sort .

TỪ KHÓA 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.