Q: populate datalist from 2 sql server 2008 tables, with sqldatasource I have a Datalist, and am using left outer join for the "leadership" table, where I am trying to get "postion". But I get the error, "DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'Position'."
CustomerTable                                    LeadershipTable
CustomerId   Name,   LeadershipPosition       Id          Position
   1         Bob        1                      1          President
   2         Greg       2                      2          vice-President
   3         Polly      4                      3          Secratary
   4         Anna       3                      4          Treasurer

<asp:DataList ID="DataList1" RepeatColumns="2" DataKeyField="CustomerId" runat="server" DataSourceID="SqlDataSource2">

And a sqldatasource populated from codebehind:
SqlDataSource2.SelectCommand = "SELECT Customer.CustomerId, Customer.FName + '   ' + Customer.LName As Name, Customer.Address1, Customer.City, Customer.State, Customer.Zip, Customer.Cell, Customer.Email, Customer.profilePic, Customer.LeadershipPosition From Customer LEFT OUTER JOIN Leadership ON Customer.LeadershipPosition = Leadership.Id WHERE Customer.CommitteeId = '1'"
    SqlDataSource2.DataBind()


A: You gave to specify the alias for "LeadershipTable.Position" as Position. Check the below code
SqlDataSource2.SelectCommand = "SELECT Customer.CustomerId, Customer.FName + '   ' + Customer.LName As Name, Customer.Address1, Customer.City, Customer.State, Customer.Zip, Customer.Cell, Customer.Email, Customer.profilePic, Customer.LeadershipPosition, LeadershipTable.Position Position From Customer LEFT OUTER JOIN Leadership ON Customer.LeadershipPosition = Leadership.Id WHERE Customer.CommitteeId = '1'"
SqlDataSource2.DataBind()

