How to: Connect to Data in an Object
You can connect your application to data in objects by running theand selecting Object as the data source type.
After completing the wizard, a data source based on the selected object is added to your project and is immediately available in the. You can drag items from the Data Sources window onto a form in your Windows application to create controls that are data-bound to the selected properties of your object. For more information, see .
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see.
Creating an Object Data Source
To create a new data source from an object
On the Data menu, click Add New Data Source.
Select Object on the Choose a Data Source Type page.
On the Select an Object you wish to bind to page, select an object already in your application.
You may need to build the project that contains your object before the object appears in the wizard.
Add a reference to an object not currently in your application by clicking Add Reference and locating the desired assembly in the. The assembly is added to the tree view.
Expand the assembly that contains the object you want to bind to and select the object in the tree view.
The data source is added to the Data Sources window.
Creating Controls That Are Bound to Your Object
To add functionality to your application
Choose Show Data Sources on the Data menu to display the Data Sources window.
Select an item in the Data Sources window and drag it onto a form to create a control that is bound to the properties in your object. Repeat this step as necessary for other items as needed.
For more information, see.