Method Search
Search(String, IDictionary)
Performs search on the Cache based on the query specified.
Declaration
[Obsolete("use ExecuteReader instead")]
public virtual ICollection Search(string query, IDictionary values)
Parameters
Type | Name | Description |
---|---|---|
System.String | query | simple SQL like query syntax to query objects from cache |
System.Collections.IDictionary | values | The IDictionary of attribute names and values. |
Returns
Type | Description |
---|---|
System.Collections.ICollection | Returns a list of cache keys |
Examples
These operators are supported by NCache Queries.
- Comparison Operators = , == , != , <> , < , > , <=, >=, IN
- Logical Operators AND , OR , NOT
- Miscellaneous () , DateTime.Now , DateTime("any date time compatible string")
Hashtable values = new Hashtable();
values.add("Name", "Paul Jones");
"select Test.Application.Employee where this.Name = ?"
values.add("Salary", 2000);
"select Test.Application.Employee where this.Salary > ?"
values.Add("Name", "Paul jones");
values.Add("Salary", 2000);
"select Test.Application.Employee where this.Name = ? and this.Salary > ?"
values.Add("Name", "Paul Jones");
values.Add("Salary", 2000);
"select Test.Application.Employee where Not(this.Name = 'Paul Jones' and this.Salary > 2000)"