Which of the following actions should you take?

You are employed as an application developer at ABC.com. You make use of Microsoft .NET
Framework 4 to develop Windows Forms applications. After developing a new application, named
ABCApp13, you include a custom class named ABCClient.
You have configured a new object data source, and also added a BindingSource component
named ABCclientBindingSource to a Windows Form. The ABCclientBindingSource component is
configured to be data-bound to the ABCClient data source.
You then configure the Windows form to have two TextBox controls for presenting and modifying
ABCClient. You have bound the data of these controls to its own ABCclientBindingSource
property. The Windows form is also configured to contain an ErrorProvider component, named
errorProvider. The data entries for the TextBox controls will be validated by the ErrorProvider
component.
You want to configure the validation process to occur automatically.
Which of the following actions should you take?

You are employed as an application developer at ABC.com. You make use of Microsoft .NET
Framework 4 to develop Windows Forms applications. After developing a new application, named
ABCApp13, you include a custom class named ABCClient.
You have configured a new object data source, and also added a BindingSource component
named ABCclientBindingSource to a Windows Form. The ABCclientBindingSource component is
configured to be data-bound to the ABCClient data source.
You then configure the Windows form to have two TextBox controls for presenting and modifying
ABCClient. You have bound the data of these controls to its own ABCclientBindingSource
property. The Windows form is also configured to contain an ErrorProvider component, named
errorProvider. The data entries for the TextBox controls will be validated by the ErrorProvider
component.
You want to configure the validation process to occur automatically.
Which of the following actions should you take?

A.
You should consider throwing an exception when the value is invalid to apply the validation
rules inside the TextChanged event handler of each TextBox control by throwing an exception
when the value is invalid. You should also consider inserting the code shown below in the
InitializeComponent method of the Windows Form.
this.errorProvider.DataSource = this.ABCclientBindingSource;

B.
You should consider throwing an exception when the value is invalid to apply the validation
rules inside the TextChanged event handler of each TextBox control by throwing an exception
when the value is invalid. You should also consider inserting the code shown below in the
InitializeComponent method of the Windows Form.
this.errorProvider.DataSource = this.ABCclientBindingSource.DataSource;
this.errorProvider.DataMember = this.ABCclientBindingSource.DataMember;

C.
You should consider throwing an exception when the value is invalid to apply the validation
rules inside the setter of each property of the ABCClient class. You should also consider inserting
the code shown below in the InitializeComponent method of the Windows Form.
this.errorProvider.DataSource = this.ABCclientBindingSource.DataSource;
this.errorProvider.DataMember = this.ABCclientBindingSource.DataMember;

D.
You should consider throwing an exception when the value is invalid to apply the validation
rules inside the setter of each property of the ABCClient class. You should also consider inserting
the code shown below in the InitializeComponent method of the Windows Form.
this.errorProvider.DataSource = this.ABCclientBindingSource;

Explanation:



Leave a Reply 0

Your email address will not be published. Required fields are marked *