Filter Names With an Asterix

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an account list. There's an asterix in the account name if it has
closed. For example, Acm* Corp. I don't agree with this design but that's
what our company came up with. Anyway, I'm trying to filter out these closed
accounts from my datagrids. In Access, I used to write WHERE ACCDESC NOT
"*[*]*" and that would filter them out. Not so in vb.NET. Anyone know how to
accomplish this? Thanks!
 
What do you mean by "VB.NET"? You must be using a specific .NET
Framework class to hold your data, which you are trying to filter.

I'll assume you are using the RowFilter property on a DataView. If not,
this answer may not apply.

With a DataView named dv, this should work:

dv.RowFilter = "accdesc not like '%[*]%'";


Joshua Flanagan
http://flimflan.com/blog
 
That worked perfectly. THANKS!

Joshua Flanagan said:
What do you mean by "VB.NET"? You must be using a specific .NET
Framework class to hold your data, which you are trying to filter.

I'll assume you are using the RowFilter property on a DataView. If not,
this answer may not apply.

With a DataView named dv, this should work:

dv.RowFilter = "accdesc not like '%[*]%'";


Joshua Flanagan
http://flimflan.com/blog


Mike said:
I have an account list. There's an asterix in the account name if it has
closed. For example, Acm* Corp. I don't agree with this design but that's
what our company came up with. Anyway, I'm trying to filter out these closed
accounts from my datagrids. In Access, I used to write WHERE ACCDESC NOT
"*[*]*" and that would filter them out. Not so in vb.NET. Anyone know how to
accomplish this? Thanks!
 
Back
Top