I have a problem with binding data using BindingSource, typed dataset and DataGridView. My problem is: BindingSource, therefore grid, is empty after binding data (bindingSource.Count is 0). I couldn't figure out what I'm doing wrong and I'd be very happy if anyone could help me with this. My application structure is like this: I have two assemblies, one is Winforms UI and other is database class library.
UI
- DataGridView, datasource as BindingSource
- BindingSource, datasource = DBAssembly.typedDataset, datamember = DBAssembly.typedDataset.myTable
Database assembly
- Sql Server CE database
- Typed Dataset
- DB class for database operations
UI Code
OnLoad
this.db = new DB();
db.BindData();
DB Code
constructor
create typedDataSet object
create typedDataSetTableAdapters.MyTableTableAdapter object
create typedDataSetTableAdapters.TableAdapterManager object
BindData()
this.myTableTableAdapter.Fill(this.typedDataSet.MyTable)
I'd appreciate any help with this.