Index: src/Libraries/Hyena/Hyena.Query/StringQueryValue.cs
===================================================================
--- src/Libraries/Hyena/Hyena.Query/StringQueryValue.cs	(revision 5007)
+++ src/Libraries/Hyena/Hyena.Query/StringQueryValue.cs	(working copy)
@@ -38,13 +38,15 @@
 {
     public class StringQueryValue : QueryValue
     {
-        public static readonly Operator Contains       = new Operator ("contains", Catalog.GetString ("contains"), "LIKE '%{0}%'", ":");
-        public static readonly Operator DoesNotContain = new Operator ("doesNotContain", Catalog.GetString ("doesn't contain"), "NOT LIKE '%{0}%'", true, "!:");
+        public static readonly Operator Contains       = new Operator ("contains", Catalog.GetString ("contains"), "LIKE '%{0}%'" + ESCAPE_CLAUSE, ":");
+        public static readonly Operator DoesNotContain = new Operator ("doesNotContain", Catalog.GetString ("doesn't contain"), "NOT LIKE '%{0}%'" + ESCAPE_CLAUSE, true, "!:");
         public static readonly Operator Equal          = new Operator ("equals", Catalog.GetString ("is"), "= '{0}'", "==");
         public static readonly Operator NotEqual       = new Operator ("notEqual", Catalog.GetString ("is not"), "!= '{0}'", true, "!=");
-        public static readonly Operator StartsWith     = new Operator ("startsWith", Catalog.GetString ("starts with"), "LIKE '{0}%'", "=");
-        public static readonly Operator EndsWith       = new Operator ("endsWith", Catalog.GetString ("ends with"), "LIKE '%{0}'", ":=");
+        public static readonly Operator StartsWith     = new Operator ("startsWith", Catalog.GetString ("starts with"), "LIKE '{0}%'" + ESCAPE_CLAUSE, "=");
+        public static readonly Operator EndsWith       = new Operator ("endsWith", Catalog.GetString ("ends with"), "LIKE '%{0}'" + ESCAPE_CLAUSE, ":=");
 
+        private const string ESCAPE_CLAUSE = " ESCAPE '\\'";
+
         protected string value;
 
         public override string XmlElementName {
@@ -79,7 +81,15 @@
 
         public override string ToSql ()
         {
-            return String.IsNullOrEmpty (value) ? null : value.Replace ("'", "''");
+            return String.IsNullOrEmpty (value) ? null : EscapeLike (value);
         }
+
+        private static string EscapeLike (string orig)
+        {
+            return orig.Replace ("'", "''")
+                       .Replace ("\\", "\\\\")
+                       .Replace ("%", "\\%")
+                       .Replace ("_", "\\_");
+        }
     }
 }
