JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Immediate Solutions: Using the DataBindings Property for Data Binding

You use the DataBindings property to access the data bindings for a control, including a Windows form. This property returns an object of the ControlBindings Collection class:

Public ReadOnly Property DataBindings As ControlBindingsCollection

By adding Binding objects to the returned collection, you can data-bind any property of a control to the property of an object. We saw this example in the In Depth section of this chapter:

DateTimePicker1.DataBindings.Add _
    (New Binding("Value", DataSet11, "customers.DeliveryDate"))

You also can use another overloaded form of the Add method to create a simple data binding, like this:

TextBox1.DataBindings.Add("Text", DataSet11, "authors.au_lname")
Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor