1

Visual Studio (2005 Professional), Windows Forms application : I've got a form which contains 8 tabs, each of them containing a few dozen of controls. Each of them is bound to an element of a typed dataset. This great except for the fact that data binding errors can only be found at runtime, and are often silent.

Typical case : I have to rename a column in a table of the dataset, and I forget to update the data binding information for one control that is linked to this column...

Do you know of a way to :

  • detect unbound controls in a form ?
  • detect controls that are bound to invalid (non existent) data ?

1 Answer 1

2

You can use unit tests. In one of the test you will create instance of form, set some sample data and then iterate all controls and check for databinding. If is bounded to data, try to read/write value. If you get exception, you know where si bug.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.