W
Wayne Wengert
I am trying to use the built-in SQLConnection, SQLDataAdapter and Dataset
components to populate the items in a DropDown List. I configured the
connection, adapter anbd dataset and can preview the data. In the PageLoad
event I have the following code:
-------------------------------
SqlDataAdapter1.Fill(DataSet11, "Regional")
DropDownList1.DataBind()
-------------------------------
When I run the page I get the following error. I am not certain what it is
saying? Any pointers will be appreciated.
===========================================
Index 0 is not non-negative and below total rows count.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: Index 0 is not
non-negative and below total rows count.
Source Error:
Line 22: <asp:ListItem Value="Perc">Perc</asp:ListItem>
Line 23: </asp:RadioButtonList>
Line 24: <aspropDownList id=DropDownList1 style="Z-INDEX: 105; LEFT:
216px; POSITION: absolute; TOP: 104px" runat="server" Width="169px"
Height="24px" DataSource='<%# DataBinder.Eval(DataSet11,
"Tables[Regionals].DefaultView.[0].RegionalID") %>'
DataTextField="RegionalID" DataMember="Regionals"
DataValueField="RegionalID" AutoPostBack="True">
Line 25: </aspropDownList>
Line 26: <asp:Label id="Label4" style="Z-INDEX: 106; LEFT: 219px;
POSITION: absolute; TOP: 82px" runat="server"
components to populate the items in a DropDown List. I configured the
connection, adapter anbd dataset and can preview the data. In the PageLoad
event I have the following code:
-------------------------------
SqlDataAdapter1.Fill(DataSet11, "Regional")
DropDownList1.DataBind()
-------------------------------
When I run the page I get the following error. I am not certain what it is
saying? Any pointers will be appreciated.
===========================================
Index 0 is not non-negative and below total rows count.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.IndexOutOfRangeException: Index 0 is not
non-negative and below total rows count.
Source Error:
Line 22: <asp:ListItem Value="Perc">Perc</asp:ListItem>
Line 23: </asp:RadioButtonList>
Line 24: <aspropDownList id=DropDownList1 style="Z-INDEX: 105; LEFT:
216px; POSITION: absolute; TOP: 104px" runat="server" Width="169px"
Height="24px" DataSource='<%# DataBinder.Eval(DataSet11,
"Tables[Regionals].DefaultView.[0].RegionalID") %>'
DataTextField="RegionalID" DataMember="Regionals"
DataValueField="RegionalID" AutoPostBack="True">
Line 25: </aspropDownList>
Line 26: <asp:Label id="Label4" style="Z-INDEX: 106; LEFT: 219px;
POSITION: absolute; TOP: 82px" runat="server"