ahooi Posted July 7, 2005 Posted July 7, 2005 hi, i face some problem in using rowfilter for visual basic.net. As i know, if the string contains either [ or ], then these two characters must be escaped in square bracket like [[] or []]. for example, if the string is "hello[test]", then it must be written as "hello[[]test[]]". Now, i face the problem when the string contains #. Do you know the escape character for #? Please help me!!!!! Thank you. From, Ooi Aik Heng Quote
jmcilhinney Posted July 7, 2005 Posted July 7, 2005 If you're talking about column names, this works for actual SQL commands but I'm not sure about the RowFilter property. Put (what I call) reverse single quotes around the table or column name and you shouldn't have to escape any characters. I mean the (`) character, which is on the same key as the tilde (~). If you've ever used the Data Adapter Configuration Wizard, you should be aware that these characters are added by default to all auto-generated SQL statements for just that reason. Quote
ahooi Posted July 8, 2005 Author Posted July 8, 2005 Rowfilter Hi, can you please try to filter the following data using rowfilter and see whether it works or not. Note: Have to escape [ and ].So, [ is written as [[] and ] is written as []] Three records in the database are: 1# [1222 -2201] 3# [1212 - 2200] 12# [1122 - 3201] Let say i want to get the third record with one of the string below, i can get the desired data. '%12%' '%12#%' '%[[]%' '%[]]%' '%[[]1122%' '%[[]1122 - 3201[]]%' '%#%' '%-%' However, i can't get the third record if i use one of thestring below. '%# %' (a space after #) '%# [[]%' '%12# [[]%' '%12# %' (a space after #) '%# [[]1122%' '%12# [[]1122 - 3201[]]%' I think that the reason the rowfilter can't get the correct record is because the # is the reserved word.So, i'm finding the escape letter for #. I can't find any help in MSDN. I also tried [#] and \# but they didn't work. Can you help me?:( Quote
jmcilhinney Posted July 8, 2005 Posted July 8, 2005 Did you try another # symbol. Often doubling up a special character serves to escape it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.