matt helpe me !

Data Access Application Blocks Forum

matt helpe me !

Postby tenvick on Wed Jun 11, 2008 12:48 am

I want to run sql \"select * from news where keyword like '&key1&' or keyword like '%key2%' or keyword like '%key3%' ... \"

how can I do ?

I write like this

CateNewsView obj = new CateNewsView();
foreach (string key in keywords)
{
if (key != string.Empty)
{
obj.Where.KeyWords.Value = \"%\" + key + \"%\";
obj.Where.KeyWords.Operator = NCI.EasyObjects.WhereParameter.Operand.Like;
obj.Where.KeyWords.Conjunction = NCI.EasyObjects.WhereParameter.Conj.Or;

}
}

obj.Query.Load();
return obj.DefaultView;
but it doesnt right .it only one KeyWords
implssible is nothing
tenvick
Lurker
 
Posts: 9
Joined: Fri Aug 17, 2007 3:41 am

Postby mgnoonan on Fri Jun 13, 2008 3:02 pm

Hi Tenvick,

You need to use TearOffs when using the same column more than once. See this example from dOOdads:

http://www.mygenerationsoftware.com/phpbb3/viewtopic.php?t=107
Matt Noonan
EasyObjects.NET - The O/RM for the Enterprise Library
http://www.easyobjects.net
User avatar
mgnoonan
Expert
 
Posts: 1019
Joined: Tue Sep 14, 2004 3:17 am
Location: Springboro, OH


Return to EasyObjects.NET (Microsoft Enterprise Library)

Who is online

Users browsing this forum: No registered users and 1 guest