kasdoffe Posted July 21, 2005 Posted July 21, 2005 (edited) 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. (didn't 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, i'm using C#. Edited July 21, 2005 by kasdoffe Quote
kasdoffe Posted July 21, 2005 Author Posted July 21, 2005 I figured it out, myTable.Select("column0 like '%[*]'") returns the rows i need! 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.