问问题
434 次
1 回答
1
I don't think it's possible to use parameters with a DataView
. You can do a simple string replace to escape single quotes.
dv.rowfilter= “col like ‘%” & searchtext.Replace("'", "''") & “%’”
or use String.Format
which, personally, i think is a little cleaner.
dv.rowfilter= String.Format(“col like ‘%{0}%’”, searchtext.Replace("'", "''"));
于 2009-12-04T01:24:23.593 回答