I created a simple search form with a gridview result.
The DataSource control markup looks like this:
<data:AirportCodeDataSource ID="AirportCodeDataSource1" runat="server" SelectMethod="GetPaged" EnablePaging="true" EnableSorting="true">
<Parameters>
<data:SqlParameter Name="WhereClause" UseParameterizedFilters="false">
<Filters>
<data:AirportCodeFilter Column="CountryCode" ControlID="ddlCountryList" />
<data:AirportCodeFilter Column="City" ControlID="txtSearch" ComparisionType="Like" />
</Filters>
</data:SqlParameter>
</Parameters>
</data:AirportCodeDataSource>
When I attempt to do a search, no matter what I type in to my txtSearch, I always end up with an empty result.
If I change ComparisionType (Which is spelled incorrectly, by the way (hint: It's Comparison)) to "Contains", I am able to perform a search.
If I type in "Grand", I end up with the appropriate results. However, if I type in "Grand Rapids", my query does not find the record it is supposed to, even though I know it is there.
Is this because "Grand Rapids" gets encoded or something along the way? Does anyone know how I can get around this issue?
Thanks.
Edit: Ok, I see that if I use the ComparisonType of "Like", If I enter the wildcards % in to my text box, the search performs as it should. I still don't understand the spacing issue.
Edit 2: I have also found that several of the read-only properties of SqlParameter.cs are commented that they are writable.
I'm outside ur box, shiftin' ur paradigm.