I have a problem with binding data using the binding source, type dataset and Datagreed scene. My problem is this: binding data, so the grid is empty after binding data (binding source. Is count 0). I could not understand what I was doing and I would be very happy if someone could help me with this. My application structure is like this: I have two assemblies, one is a WinForm UI and the other is database class library.
UI
- Datagridviev,
- SQL server CE database
- typed dataset
- DB class
UI code for database operation
Onload
this.db = new db (); Db.BindData ();
DB code
constructor
typed dataset object Create type Krendetasettab adapter type .MyTableTableAdapter object DataSetTableAdapters.TableAdapterManager object
BindData ()
this.myTableTableAdapter.Fill ( This.typedDataSet.MyTable)
I appreciate any help with this.
Well, the first thing to ask is: what's this. Typed datedate.mighty.your.ccount
? That is what the adapter did? If not, then there is nothing to do with it.
It is assumed that it is not empty, then Precise code do you have DataSource
and datamember
? I hope this should be:
binding source. Data source = this.typedDataSet; BindingSource.DataMember = "MyTable"; DataGridView.DataSource = Binding Source;
Alternatively, you > this.typedDataSet.MyTable
table left empty Are there.
Actually, I hope you have told it type of estimated data, but by now you have not actually given it a data-set / data-table that you Want to use.
Comments
Post a Comment