[Mono-list] problem about "like"

billow dragon billowdragon at gmail.com
Sun Dec 2 21:40:38 EST 2007


hi,guys:

Now i am in this situation:I want to use the cause "like",i wrote:
string commd = "select * from buyerinfo where BuyerName like '%?blurName%'";
MySqlParameter para = new MySqlParameter("?blurName", MySqlDbType.VarChar,
45, "BuyerName");
para.Value = blurName;

It didn't work.
I changed that like this:
string commd = "select * from buyerinfo where BuyerName like
'%"+"?blurName"+"%'";
MySqlParameter para = new MySqlParameter("?blurName", MySqlDbType.VarChar,
45, "BuyerName");
para.Value = blurName;
 or:
blurName="'%"+"blurName"+"%'";
string commd = "select * from buyerinfo where BuyerName like ?blurName";
MySqlParameter para = new MySqlParameter("?blurName", MySqlDbType.VarChar,
45, "BuyerName");
para.Value = blurName;
or:
string commd = "select * from buyerinfo where BuyerName like '%?blurName%'";
MySqlParameter para = new MySqlParameter("?blurName", MySqlDbType.VarChar,
45, "BuyerName");
para.Value = blurName;

It also didn't work, when executed ,It returned nothing ,which definitely
wrong.
Any advise will be appreciated,thx!

--
Best regards£¡

haitao

-- 
Best regards!

º£ÌÎ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20071203/5ac2e3eb/attachment-0001.html 


More information about the Mono-list mailing list