You are busy adding a TextBox control named Certkiller TextBox to a form. You are doing this by dragging a Contact field from the Data Sources window to the form. The data of the Text properties of the Certkiller TextBox is part of the Contact field. To navigate the records in a data source, you added two Button controls to the form. Which code segment should you use to programmatically move the next record and display the new value of the Certkiller TextBox’s Contact field when the Domain.com users click one of the Button controls?
A.
Binding binding = Certkiller TextBox.DataBindings[“Text”];
binding.BindingManagerBase.Position += 1;
B.
Binding binding = Certkiller TextBox.DataBindings[“Contact”];
binding.BindingManagerBase.Position += 1;
C.
Certkiller TextBox.BindingContext[“Text”].Position += 1;
D.
Certkiller TextBox.BindingContext[“Contact”].Position += 1;
Explanation:
The Windows Forms control has a DataBindings property that represents a collection of Binding instances. When data source members change, the Binding class allows a control’s property to be updated automatically.Incorrect Answers:
B, C, D: When you pass the value Contact as the parameter to the DataBindings property, you should not get a Binding instance ManagerBase instance. Furthermore you should not pass the name of the property as a parameter to the BindingContext property.