|
rdouglass -> RE: Database query (3/30/2008 14:58:36)
|
quote:
<asp:AccessDataSource runat="server" ID="AccessDataSource2" DataFile="App_Data/saqcc.mdb" SelectCommand="SELECT [Initials], [Surname], [Employer], [Suburb], [SubDesc], [Town] FROM [AP-Details] WHERE ([Suburb] = ?)"> <SelectParameters> <asp:controlparameter PropertyName="SelectedValue" Type="String" Name="Suburb" ControlID="DropDownList1" /> </SelectParameters> </asp:AccessDataSource> Something like this maybe? <asp:AccessDataSource runat="server" ID="AccessDataSource2" DataFile="App_Data/saqcc.mdb" SelectCommand="SELECT [Initials], [Surname], [Employer], [Suburb], [SubDesc], [Town] FROM [AP-Details] WHERE ([Suburb] = @Suburb) OR ([Town] = @Suburb)"> <SelectParameters> <asp:controlparameter PropertyName="SelectedValue" Type="String" Name="Suburb" ControlID="DropDownList1" /> </SelectParameters> </asp:AccessDataSource> See what I did? Since we're using the same dropdown, I really didn't need to define a second select parameter but rather just reused it in the query. Does that help any?
|
|
|
|