setdatabinding to a schema, not a relation

  • Thread starter Thread starter codefragment
  • Start date Start date
C

codefragment

Hi
I want to bind a datagrid to a dataset for the table
"ProductProductPhoto" in the AdventureWorks database in
SQL Server 2005, however I can't because the binding fails on
Production.ProductProductPhoto, presumably because it thinks theres
some kind of relation in effect here. So how do you do it?

I get the error message: Child list for field Production cannot be
created.

ta
 
When is this occuring? When you are creating the data set, or when you
are binding the data set to the table? How are you populating the data set?
 
When is this occuring? When you are creating the data set, or when you
are binding the data set to the table? How are you populating the data set?

recordsDataGrid.SetDataBinding(recordsDataSet, "ProductProductPhoto");

I populate the dataset using:

SqlDataAdapter adapter = new SqlDataAdapter(queryString,
dataConnection);
adapter.Fill(dataSet, selectedTable);
 
recordsDataGrid.SetDataBinding(recordsDataSet, "ProductProductPhoto");

I populate the dataset using:

SqlDataAdapter adapter = new SqlDataAdapter(queryString,
dataConnection);
adapter.Fill(dataSet, selectedTable);

ok, using the below is a workaround for now, I'll have to check if
the newer controls have the same problem

recordsDataGrid.DataSource = recordsDataSet.Tables[0];
 

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

Back
Top