I am displaying some information in DataList.
Can i bind the DataList to two DataSources.??
since i am facing a situation in which the two rows needs to be populated from two different Tables. Below is what i am trying to do.
<asp:DataList runat="server" id="myDataList">
<ItemTemplate>
<b><%# DataBinder.Eval(Container.DataItem, "Column from DataSource1") %></b>
<br />
<%# DataBinder.Eval(Container.DataItem, "Column from DataSource2") %>
</ItemTemplate>
</asp:DataList>
It is not possible to bind 2 data sources to a single item.
Ideally from database you must be getting the data by using the JOINS, if that is not possible than in your server side code make a datatable, fill it from the both data sources in such a way that in custom data table you have one row against each row in both data sources and than bind that data table with your data list.