Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
Dim txt As
String = e.Form.Controls("TextBox1").Value
Dim dst As WinForm.DataList = e.Form.Controls("DataList1")
If txt = "" Then
dst.RowFilter = ""
Else
txt = "'*" & txt.Replace("'","''") & "*'" '如果用户输入的条件中带单引号,自动将其替换为两个单引号
dst.RowFilter = "客户ID Like " & txt & " Or 公司名称 Like " & txt & " Or 地址 Like " & txt & " Or 联系人 Like " & txt
End
If
特别提醒各位狐友注意,包括各种SQL语句中,只要查询条件中存在单引号,就一定要2个单引号代替。