It seems like a very commonly used method to me, yet I can't find a single article or tutorial on it anywhere.
An .aspx page with a textbox and a button. A user types in a value in this textbox and pushes the button.
Then a Datagrid control displays all the rows WHERE (columnName = TypedText).
I've spent about 16 houirs trying to figure this one out and I'm soooooo close, but when the page runs it says there's an "Undefined function 'WHERE' in expression." after I type in a vaild value and click the button.
Here's the code:
Code:
<asp:TextBox ID="TextBox1" runat="server" ToolTip="Type your Inspector ID here"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" /><br />
<br />
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/weeklyPipe.mdb"
SelectCommand="SELECT [SRID], [OwnersNameFirst], [OwnersNameLast], [PropertyAddress], [City], [ZipCode], [ContactHomePhone], [ContactWorkPhone], [ContactCellPhone], [InspectorName] FROM [cert_inpGeneralInfo] ORDER BY [InspectorName], [ZipCode], WHERE (InspectorName = ?)">
<SelectParameters>
<asp:ControlParameter ControlID="TextBox1" Name="?" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:AccessDataSource>
<br />
</div>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
DataSourceID="AccessDataSource1" Font-Names="Arial" Font-Size="8pt" PageSize="100">
</asp:GridView>
(yup, all the column names are spelled 100% correctly.)