Data Binding to Host Controls on Worksheets

VSTO makes it easy to bind data to host controls. In Excel, you can use simple data binding on NamedRange controls, or complex data binding on ListObject controls. In simple data binding, you bind a single data element to a property of a control, such as the Value property of a NamedRange control. In complex data binding, you bind a control property to more than one data element.

The easiest way to bind data to a NamedRange control is to use the Data Sources window so that you can add a control that is already bound to data in your worksheet. In this section you will use the Data Sources window to add a connection to the Northwind database in Microsoft Access and bind some of its data to a NamedRange control and a ListObject control. Alternatively, you can use the Northwind database in SQL Server.

0 0

Post a comment