R
Ray Valenti
I have a ASP listbox that I am trying to populate with two fields, one for
display (Category) and one to store (ID) as the selected item. I can
successfully populate and view the list. How ever after specifying the
field to hold the selected value with the Databindings property, the error
below show up.
VS changes the DataSource from DSMain1 to the expression:
DataBinder.Eval(dsMain1, "Tables[Links].DefaultView.[0].fkeyCategory")
Can I bind to both the list source (two fields) and a field that holds the
selected value at the same time?
-Ray
---- error
returned -------------------------------------------------------------------
--------------------
An invalid data source is being used for lstCategory. A valid data source
must implement either IListSource or IEnumerable.
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.ArgumentException: An invalid data source is being
used for lstCategory. A valid data source must implement either IListSource
or IEnumerable.
Source Error:
Line 63: <TD><asp:textbox id=txtExpirationDate runat="server" Text='<%#
DataBinder.Eval(dsMain1, "Tables[Links].DefaultView.[0].ExpirationDate")
%>'></asp:textbox></TD>
Line 64: <TD></TD>
Line 65: <TD rowSpan="4"><asp:listbox id=lstCategory runat="server"
DataValueField="ID" DataTextField="Category" DataMember="Category"
DataSource='<%# DataBinder.Eval(dsMain1,
"Tables[Links].DefaultView.[0].fkeyCategory") %>' Width="150px"
Height="130px"></asp:listbox></TD>
Line 66: </TR>
Line 67: <TR>
Source File: c:\inetpub\wwwroot\Quixor\links\LinkAdd.aspx Line: 65
display (Category) and one to store (ID) as the selected item. I can
successfully populate and view the list. How ever after specifying the
field to hold the selected value with the Databindings property, the error
below show up.
VS changes the DataSource from DSMain1 to the expression:
DataBinder.Eval(dsMain1, "Tables[Links].DefaultView.[0].fkeyCategory")
Can I bind to both the list source (two fields) and a field that holds the
selected value at the same time?
-Ray
---- error
returned -------------------------------------------------------------------
--------------------
An invalid data source is being used for lstCategory. A valid data source
must implement either IListSource or IEnumerable.
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.ArgumentException: An invalid data source is being
used for lstCategory. A valid data source must implement either IListSource
or IEnumerable.
Source Error:
Line 63: <TD><asp:textbox id=txtExpirationDate runat="server" Text='<%#
DataBinder.Eval(dsMain1, "Tables[Links].DefaultView.[0].ExpirationDate")
%>'></asp:textbox></TD>
Line 64: <TD></TD>
Line 65: <TD rowSpan="4"><asp:listbox id=lstCategory runat="server"
DataValueField="ID" DataTextField="Category" DataMember="Category"
DataSource='<%# DataBinder.Eval(dsMain1,
"Tables[Links].DefaultView.[0].fkeyCategory") %>' Width="150px"
Height="130px"></asp:listbox></TD>
Line 66: </TR>
Line 67: <TR>
Source File: c:\inetpub\wwwroot\Quixor\links\LinkAdd.aspx Line: 65