PC Review


Reply
Thread Tools Rate Thread

Accessing tables inside a dataset to display in a datalist

 
 
=?Utf-8?B?TW9vampvbw==?=
Guest
Posts: n/a
 
      18th Jul 2005
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?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?RWx0b24gVw==?=
Guest
Posts: n/a
 
      18th Jul 2005
Hi Moojjoo,

It seems you should use code like follows:

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


// Fill data to employeePhotos

ds.Tables.Add(employeePhotos);

HTH

Elton Wang
(E-Mail Removed)





"Moojjoo" wrote:

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

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
setting SelectedIndex of DataList nested inside of DataList? Les Caudle Microsoft ASP .NET 0 2nd May 2006 11:44 PM
Accessing Child Controls inside a dataset or datagird =?Utf-8?B?TW9vampvbw==?= Microsoft C# .NET 4 14th Jul 2005 08:39 PM
accessing the dataset tables, by name and not by index roni Microsoft ADO .NET 3 13th Jul 2005 05:53 PM
datalist - display info from 2 tables Joe Van Meer Microsoft ASP .NET 4 8th May 2004 04:13 PM
display columns from 2 tables in datalist Joe Van Meer Microsoft ASP .NET 0 7th May 2004 03:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:47 PM.