|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ObjectDataSource field binding to DataSet does not workI built a dataset with 11 tables and their relationships using the data set
builder. I removed all the table adapters: the intention is to use the Enterprise Library to load the data, and to do the updates. That side of things works fine. The plan is to use ObjectDataSource to bind web controls to the tables in the data set. Unfortunately the data source does not show any of the fields in the table I am returning. The class I am linking to the data source has a bunch of parameter-less methods to return each of the tables in the data set. These are strongly typed, but the signature of my method is GetCompany(), returns DataTable, and I specify it as the Select method. I have verified that the method is called at run-time, but the details view does not appear, even with a manual bound field. How do I bind do a table in a dataset? Found the deliberate error. I should have returned the strongly typed data
table instead of DataTable, i.e. public EmployerDataSet.EmployerDataTable GetEmployer() { return ds.Employer; } instead of public DataTable GetEmployer() { return ds.Employer; } Show quote "Jamie Oglethorpe" wrote: > I built a dataset with 11 tables and their relationships using the data set > builder. I removed all the table adapters: the intention is to use the > Enterprise Library to load the data, and to do the updates. That side of > things works fine. > > The plan is to use ObjectDataSource to bind web controls to the tables in > the data set. Unfortunately the data source does not show any of the fields > in the table I am returning. > > The class I am linking to the data source has a bunch of parameter-less > methods to return each of the tables in the data set. These are strongly > typed, but the signature of my method is GetCompany(), returns DataTable, and > I specify it as the Select method. I have verified that the method is called > at run-time, but the details view does not appear, even with a manual bound > field. > > How do I bind do a table in a dataset? |
|||||||||||||||||||||||