[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

VB.net Filter Syntax

Posted on 2013-01-17
2
Medium Priority
?
346 Views
Last Modified: 2013-01-17
Hi

To set a LIKE filter on a DataTable for column [Payment Type] do I use the following syntax

ds.Tables("MyTable").DefaultView.RowFilter = "(Payment Type LIKE '*x*' OR Payment Type LIKE '*x*')"

OR do I use:

ds.Tables("MyTable").DefaultView.RowFilter = "([Payment Type] LIKE '*x*' OR [Payment Type] LIKE '*x*')"
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 38786252
RowFilter does not like [ ] so try without those. Also, use '%x%' instead of '*x*'.


ds.Tables("MyTable").DefaultView.RowFilter = "Payment Type LIKE '%x%' OR Payment Type LIKE '%x%'"


But you may have issues on that column name.
0
 

Author Closing Comment

by:Murray Brown
ID: 38786256
Thanks. I got errors saying with square brackets so thanks for the validation
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question