I am attempting to use a Details view.
This is my DataSource
I am passing it this way.
IEnumerable<DataRow> row = Connection.GetDataTable([sql]).AsEnumerable();
this.dvOrderInformation.DataSource = row;
this.dvOrderInformation.DataBind();
I am binding it like so.
<asp:DetailsView ID="dvOrderInformation" runat="server" Height="50px" Width="100%" AutoGenerateRows="false">
<HeaderTemplate>
Order
</HeaderTemplate>
<FieldHeaderStyle Width="150px" />
<Fields>
<asp:BoundField HeaderText="Order Number:" DataField="OrderID" />
</Fields>
</asp:DetailsView>
When I try this I get the message.
DataBinding: 'System.Data.DataRow' does not contain a property with the name 'OrderID'.
or
A field or property with the name 'OrderID' was not found on the selected data source.
If I bind this directly to a DataGrid it works fine. Any ideas what I am doing wrong here.