ObjectDataSource field binding to DataSet does not work

G

Guest

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?
 
G

Guest

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;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top