DataSet binding problem

Posted by Shaine on Stack Overflow See other posts from Stack Overflow or by Shaine
Published on 2010-05-21T05:45:30Z Indexed on 2010/05/21 5:50 UTC
Read the original article Hit count: 176

Filed under:
|
|

I've got in-memory dataset with some table defined and I populate this table in a following way:

for(...)
    ds.Fields.AddFieldsRow(++j, 0, heading, "Char", "", "", "Input", 0, "","","");

On the GUI I've got DataGridView bound to that table inside TabControl (bound through BindingSource).

Very strange thing is happening: if I open tab pane with this grid and populate table with some data then I see changes in grid. On the other side if I'm at other tab, populate table, and then switch to tab with grid I've got following exception: "DataMember property 'Fields' cannot be found on the DataSource".

In similar way I've got 2 tab panes with grid in each that are bound to the same datatable using different datasources and I open one of them, populate, see the changes, then switch to second tab and get crash.

What am I missing?

© Stack Overflow or respective owner

Related posts about .NET

Related posts about c#