In T-SQL, how do I write the query to select rows for any integer value for a column??
For example, the data is like this
NAME,AGE
A,10
B,20
C,10
D,20
and There's a <asp:dropdownlist>
that has two options, 10,20
, so that a user can select either 10
or 20
. If the user selects 10
or 20
, The data is being pulled correctly, but how do I say a *
condition?? - like select ALL data for ANY value in the age
column??
My code is as follows,
select ...where (AGE = @AGE)
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="AGE" PropertyName="SelectedValue"
DbType="Int32" DefaultValue="ANY"
Also, the follow query works perfectly in the SSMS, but how to implement this behavior in asp.net SqlDataSource??
SELECT * FROM [TABLE] where AGE is not null
If the column AGE was of varchar type, I am able to use the '%', but it's an numeric field
Thanks,