TAILIEUCHUNG - Creating a DataView Using Visual Studio .NET

Creating a DataView Using Visual Studio .NET In this section, you'll learn how to create a DataView using Visual Studio .NET (VS .NET) | Creating a DataView Using Visual Studio .NET In this section you ll learn how to create a DataView using Visual Studio .NET VS .NET . You can follow along with the steps described in this section 1. Open VS .NET and create a new Windows application named myDataView. 2. Display Server Explorer connect to your Northwind database and drag the Customers table to your form. This creates a SqlConnection object named sqlConnectionl and a SqlDataAdapter object named sqlDataAdapterl. These objects are placed in the tray beneath your form. 3. Alter the ConnectionString property of sqlConnectionl to connect to your Northwind database. Remember to add a substring containing the password pwd sa or similar . 4. Click on the sqlDataAdapterl object in your form and then click the Generate Dataset link at the bottom of the Properties window for sqlDataAdapterl. Accept the defaults in the dialog box and click the OK button to create a DataSet object named dataSetll. 5. Drag a DataView object from the Data tab of the Toolbox to your form. This creates a DataView object named dataViewl. 6. Set the Table property of your dataViewl object to using the drop-down list to the right of the Table property set the RowFilter property to Country UK and set the Sort property to CustomerlD. See Figure . Figure Setting the Properties of dataViewl 7. Drag a DataGrid control from the Windows Forms tab of the Toolbox to your form. This creates a DataGrid object named dataGridl. 8. Set the DataSource property of dataGridl to dataViewl using the drop-down list to the right of the DataSource property as shown in Figure . This binds the data stored in dataViewl to dataGridl and allows dataGridl to access any data stored in dataViewl. Figure Setting the Properties of dataGridl 9. Select View Code and set the Forml method of your form to 10. public Forml 11. 12. 13. Required for Windows Form Designer support 14. 15. InitializeComponent 16. 17. call the Fill method of .

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.