Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
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.
Posted

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?:(

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...