Question : DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'StateProvinceID'.

This is code on offensive line:

Line 67:                           <asp:DropDownList ID="DropDownListState" runat="server" DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="StateProvinceID" SelectedValue='<%# Bind("StateProvinceID") %>' />


This is  Data source:

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
                    ConnectionString="<%$ ConnectionStrings:QBS_1_Data_Writer_ConnectionString %>" SelectCommand="SELECT        181 AS StateProvinceID, ' ' AS Name, 'US' AS CountryRegionCode UNION SELECT StateProvinceID, Name, CountryRegionCode FROM StateProvince WHERE (CountryRegionCode = 'US') ORDER BY Name">
                </asp:SqlDataSource>

So why can't it find the "StateProvinceID"?????

Answer : DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'StateProvinceID'.

Random Solutions  
 
programming4us programming4us