TAILIEUCHUNG - Querying Document In Your Sever

Querying Data Now that you can control access to your application, you can turn your attention to querying and maintaining data. You will useWeb Server Data controls to connect to the database, query data, and maintain the data | Querying Data Now that you can control access to your application you can turn your attention to querying and maintaining data. You will useWeb Server Data controls to connect to the database query data and maintain the data in a manner similar to that used by the Windows Forms application you built in Chapter 24 Working with Data Binding and DataSets. Displaying Customer Information In the following exercises you will fetch all of the rows in the Customers table in the Microsoft SQL Server Northwind Traders database and display them in a GridView. The first task is to create a connection that you can use to connect to the Northwind database. NOTE This exercise assumes that you have completed the exercises in Chapter 23 Using a Database on your computer. Create a connection to the Northwind Database 1. Display the page in the Design View window. Delete the label displaying This form will be implemented later. 2. In the Toolbox expand the Data category. Add a SqlDataSource control to the Web form. 3. Click anywhere in the form to hide the SqlDataSource Tasks menu that appears. A control called SqlDataSourcel is added to the Web form. The SqlDataSource control is a Web Server control that performs the same tasks as a data source in a Windows Forms application. NOTE Although the SqlDataSource control appears on the Web form at design time it will not be visible when the Web form runs. 4. Using the Properties window change the ID property of SqlDataSourcel to CustomerInfoSource. 5. Select the CustomerInfoSource control on the Web Form. Click the Smart Tag icon to display the SqlDataSource Tasks menu and then click the Configure Data Source link. The Configure Data Source Wizard appears. This is very similar but not identical to the wizard you saw in Chapter 23. You will use it to create a connection to the database and fetch the data from the Customers table. 6. Click the New Connection button. Use the Add Connection page to create a new connection .

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.