今天做了個(gè)小練習(xí)碰到一個(gè) 問(wèn)題 如下 在ACCESS里面 *代表任意多個(gè)字符 所以我用.NET 做程序的時(shí)候這么寫(xiě) string strsql=select * from infor where types like '*52*' 然后用.NET執(zhí)行這句SQL 語(yǔ)句結(jié)果不行! 我有分別試了下面兩句還是不行。 string strsql=@
今天做了個(gè)小練習(xí)碰到一個(gè)問(wèn)題如下
在ACCESS里面 *代表任意多個(gè)字符
所以我用.NET 做程序的時(shí)候這么寫(xiě)
string strsql=select * from infor where types like '*52*'
然后用.NET執(zhí)行這句SQL 語(yǔ)句結(jié)果不行!
我有分別試了下面兩句還是不行。
string strsql=@select * from infor where types like '*52*'
string strsql=select * from infor where types like '%52%'
最后我用了
string strsql=@select * from infor where types like '%52%'
我想問(wèn)問(wèn)既然在ACCESS里面 可以用* 匹配符,為什么.NET這么寫(xiě)(第一條,第三條)招不到數(shù)據(jù),反而第最后條能找到數(shù)據(jù)?
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com