Accessing data in multiple tables within a dataset

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good Monday Morning:

I am at a dead stop and I am hoping some other developers out there can help
me out. I have built a dataset that first contains a table populated from
SQL Server then I am adding another table that is built from the same Query
and data from active directory. I have built a parent/child relationship and
see all the data under my locals when debugging. Where I am having the
problem is displaying the data from the second table using data binding
expressions.

<%# DataBinder.Eval(Container.DataItem, "emp_file_path") %>

I keep getting the following error:

DataBinder.Eval: 'System.Data.DataRowView' does not contain a property with
the name emp_file_path.

I am a bit lost because that data does exsist in my dataset under the table
employeePhotos:

DataTable employeePhotos = ds.Tables.Add("Employee_Photos");
employeePhotos.Columns.Add("emp_photos_ID", typeof(Int32));
employeePhotos.Columns.Add("emp_LAN_ID", typeof(String));
employeePhotos.Columns.Add("emp_file_path", typeof(String));

I guess the true question is how do I access data in different tables using
data expressions?
 
Moojjoo,

I'm not sure, but isn't the container accessing the parent, and not the
child? You would need to use the data relation binding to the child and
then access the field through there.

Hope this helps.
 

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