what I have are two tables, Publication and DTPersonnel. Publication has a primary Key and the other (DTPersonnel) has a field that is link back Publication. I sent up a DBML layout for my LinqDataSource and link the two tables.. I have added the LinqDataSource component to my web page and (for testing) a label.
I then set up the label data-binding to point to a field in DTPersonnel.DTRoleID like this:
<asp:FormView ID="FormView1" runat="server" AllowPaging="True"
DataSourceID="LinqDataSource1">
<ItemTemplate>
<asp:Label ID="Label1" runat="server"
Text='<%# BIND("DTPersonnels.DTRoleID") %>'></asp:Label>
</ItemTemplate>
</asp:FormView>
</asp:Content>
My LinqDataSource is setup like this:
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Layout.aspx.cs" Inherits="AequorPubTracker.Account.Layout" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:LinqDataSource ID="LinqDataSource1" runat="server"
ContextTypeName="AequorPubTracker.LayoutDataContext" EntityTypeName=""
onselecting="LinqDataSource1_Selecting" TableName="Publications"
Select="new (DTPersonnels.DTRoleID,PublicationID, DTPersonnels, ActLAYDate, ActRRIPDate, ActPPIDate, ActPPODate, ActECTWDate, TargetECTWDate, TargetPPIDate, TargetRRIPDate, TargetPPODate, TargetLAYDate)">
</asp:LinqDataSource>
But when I run the app in the browser I get the following error:
Exception Details: System.Web.Query.Dynamic.ParseException: No property or field 'DTRoleID' exists in type 'EntitySet`1'
I hope I gave enough information any help would be great.