Try running the full example, for which I include the source code. If you still have problems, I can’t help you without seeing your code.
]]>I do not work .. Followed step by step the tutorial but the only thing I see is the “Search” button. I do not see the TextBox (TextFilter.ascx).
Help me? Thanks!
]]>Make sure that you apply the FilterUIHint attribute on the right property, and that the class that contains the property is \glued\ to the generated partial class with the MetadataType attribute, like in the example. Also make sure that you have the ascx and code behind file for the user control in the right location, namely Filter.
You can download Northwind for free, link is in the post. Easy to setup, just copy and paste the Northwind.mdf and .ldf file in the App_Data folder, double click and there you go.
Good luck, let me know if you have trouble getting it going.
]]>ps. I haven’t tried with your project since I don’t have the NorthWind Database.
Thanks for a great initiative!
]]>The uppercase search is working now by using
var upperProperty = Expression.Call(property, typeof(String).GetMethod(“ToUpper”, new Type[] { }));
The google search rank of this post has become higher now. Great!
EDIT: –> I remove your urls, as they are not pointing to anything relevant. I see this as spam, so please don’t do it.
So change this line of code in the filter control (code behind):
string filterValue = this.textBox.Text;
To this:
string filterValue = this.TextBox.Text.ToUpper();
the rest is the same as the original implementation. You need to make sure that you apply the search field to a column that has been “pre-calculated” in the database to be all Uppercase. You could use ToUpperInvariant() as well.
If you would like to try the ToUpper combined with Contains: this is the expression to do that:
case “contains”:
var upperProperty = Expression.Call(property, typeof(string).GetMethod(“ToUpperInvariant”));
comparison = Expression.Call(upperProperty, typeof(string).GetMethod(“Contains”, new Type[] { typeof(string) }), value);
break;
Hope this helps
]]>Sorry for my newbie questions Thanks again for your guidance.
FYR. I have also tried using db features such as NLS_COMP and NLS_ORDER [_CI] but I’m using Oracle9i and I can only make it case-insensitive match on ‘=’ operator but not ‘like’ operator
so i need to do it on the coding level …..
http://www.orafaq.com/node/999
Setting NLS_COMP to ANSI causes Oracle9i to use the sort order specified in NLS_SORT when doing an ORDER BY. But one big limitation is that when NLS_COMP is set to ANSI, only certain SQL functions and operations will use the NLS_SORT sort order. The rest will still use the default BINARY sort order. For example, the = (equality) operator will do a case-insensitive comparison, but the “like” operator will not: