Problem binding a dataset to controls

PhilEngle

New member
Joined
Dec 3, 2004
Messages
3
Programming Experience
10+
I am having the following problem:

Columns in a dataset refuse to bind to the controls on a tab surface in my tabbed form. (The binding process works on the other tab surfaces.) When my code executes a DataBindings.Add statement on each control, the corresponding data for a particular column in the first record in the dataset is supposed to appear in that control. This fails to happen. Moreover, none of the controls visibly appear on the tab surface! I know the following to be true:

1. The data is there in the dataset.

2. Binding a control twice generates an error: VB.NET thinks the first binding was successful.

3. Manually mapping columns in the dataset does not solve the problem.

4. Either the dataset is refusing to bind to the controls on the tab, or the program is refusing to display the bound values in the controls.

5. As near as I can see, there is no coding difference between how databinding is being handled by the other tab surfaces and how it is being handled by the problem tab surface.

6. The database involved is a SQL Server 2000 database.

Any help you could give would be greatly appreciated!
 
phil altough as what u described looks perfect , but as we know that there is some thing missing and cant be verified until we have a view over code so try to post it so that i can do a review over it
 
2. Binding a control twice generates an error: VB.NET thinks the first binding was successful.

Um... yeah... you first have to REMOVE the first binding before attempting to add it back on.

Tg
 
Thanks for your response, guys! The solution to the problem turned out to be simple, but bizarre: Thanks to a suggestion by Joe Stegman of Microsoft that invisible controls will not bind to a dataset, I eventually discovered that a panel containing most of the controls on the offending tab surface had its Visible property set to False (due to a cosmic ray??). Of course, that caused all of the controls within the panel to have Visible=False at runtime, which in turn caused the dataset binding problem.
 
PhilEngle said:
...that invisible controls will not bind to a dataset...
That's the nuttiest thing I'v ever heard since learning about acorns.... what gives with that?

Tg
 
Back
Top