Jump to content

Getting boolean data based on Querystring

Guest Bob Anderson

Recommended Posts

Guest Bob Anderson

I have the following code further below working inside MS Access query. If Iset the [field1] field to True and no values for the other parameters is set,it returns [field1] True items in Test Query just like I want. But if I set up an url witha querystring like <A href="newsindex.aspx?field1=TRUE"> no data is returned on the page. Can anybody explain why?If I set up the url as newsindex.aspx?field1=TRUE&field2=FALSE&field3=FALSE I do get the returned data but not what I want since I then don't get the ones where say field1 and say field2 both might be TRUE.So basically I want to retrive all entries from the database where field1=True including thosewhere either field2 or field3 also maybe or not may be True. Setting up a single index webpage (asp.net 2.0 gridview) showing the data based on the querystring like below.<A href="newsindex.aspx?field1=TRUE"><A href="newsindex.aspx?field2=TRUE"><A href="newsindex.aspx?field3=TRUE">Isn't it possible to accomplish the same result from an url like I can get with a MS Access query?

<asp:SqlDataSource ID="newsindex" runat="server" ConnectionString="<%$ConnectionStrings:newsConnectionString %>"		ProviderName="<%$ConnectionStrings:newsConnectionString.ProviderName %>"		SelectCommand="SELECT [Titel], [shortintro], [Pic], [field1],[field2], [field3] FROM [mynews] WHERE(([field1] = ?) OR ([field2] = ?) OR ([field3] = ?))">  <SelectParameters>   <asp:QueryStringParameter Name="field1" QueryStringField="field1"				Type="Boolean" />			<asp:QueryStringParameter Name="field2" QueryStringField="field2"				Type="Boolean" />			<asp:QueryStringParameter Name="field3" QueryStringField="field3"				Type="Boolean" /> 		 </SelectParameters>	</asp:SqlDataSource>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...