DataTable.Select() command help

kasdoffe

Well-known member
Joined
Aug 27, 2003
Messages
57
I want to execute a SQL command using the DataTable.Select command on my datatable. Problem is my column contains data that contains asterisks (*).

I want to select all data that contains an asterisk (*).

My current command looks like: myTable.Select("column0 like %*") but this returns all rows when it should only return the single row that actually meets my requirements.

So, I tested.

1. myTable.Select("column0 like *") returns all rows. (didnt know that)
2. myTable.Select("column0 like %") returns all rows. (Yes, i knew that)
3. myTable.Select(@"column0 like %\*") returns nothing.
4. myTable.Select(@"column0 like %/*") returns nothing.

I think I need some escape character before the asterisk. Any help?

btw, im using C#.
 
Last edited by a moderator:
Back
Top