The Data Sources Window

The Data Sources window is a new feature in Visual Studio 2005 that helps you create or open data connections and bind data to controls in your solution. For example, you can add a Windows form to your solution and bind a combo box on the form to a data source. In the Data Sources window, you can select the desired control and drag it to a Windows form. Visual Studio adds a data-bound control to the Windows form and displays the data when the form is launched.

You can also drag items from the Data Sources window directly to a Word document or Excel worksheet. You can select from a number of controls, including Windows Forms controls and host controls. Figure 2.21 shows the Data Sources window with a connection to the North-wind database in Microsoft Access.

Recall from Chapter 1 that host controls are extended Office objects, such as bookmarks or ranges. Binding data to controls is described more thoroughly in Chapters 6 and 7. To view the Data Sources window, click Show Data Sources on the Data menu.

0 0

Post a comment