- Joined
- 31 Dec 2003
- Posts
- 5,172
- Location
- Barrow-In-Furness
Having some trouble getting a wildcard to work on a DropDownList.
When I try to load the page i'm getting the error:
Here's the SQL Query
And here's the relevant page code
Tried it a couple of ways but no joy, I think it's because the DataValueField is an Integer?
When I try to load the page i'm getting the error:
"Input string was not in a correct format.
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.FormatException: Input string was not in a correct format.
Source Error:"
Here's the SQL Query
Code:
SELECT Approved, Comments, Date, Hours, ID, TimeCode, Username FROM tblHours WHERE (Approved IS NULL) AND TimeCode LIKE @SelectedCodeID
And here's the relevant page code
Code:
<asp:DropDownList ID="ActiveCodesDropDownList" runat="server" AppendDataBoundItems="True"
AutoPostBack="True" DataSourceID="ObjectDataSource1" DataTextField="CodeName" DataValueField="CodeID"
Width="300px">
<asp:ListItem Value="*">-All-</asp:ListItem>
</asp:DropDownList>
Tried it a couple of ways but no joy, I think it's because the DataValueField is an Integer?