Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Best practise for multiple inputs for SQL criteria

Status
Not open for further replies.

SaturnSeven

Programmer
Aug 4, 2005
40
GB
I'm just starting out with ASP.net
I managed to get a single text box, a SQLDataSource and Gridview working together i.e. enter a value and the Gridview reflects the input and the SQL

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DBConnectionString %>"

SelectCommand="SELECT [field1] AS Field1, [field2] AS Field2, FROM
WHERE ([field1] = @Field1)">

<SelectParameters>
<asp:ControlParameter ControlID="txtInput" Name="Field1" PropertyName="Text" Type="String" />
</SelectParameters>
</asp:SqlDataSource>

But how do I set say 4 text boxes for various criteria? But so that the gridview works if any if the text boxes are entered and not all of them

Any guidence or examples would be great
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top