Dim cmd As New SQLCommand
cmd.C
Dim dst As WinForm.DataList = e.Form.Controls("DataList7")
Dim str As String = e.Form.Controls("TextBox28").Value
If str is nothing Then
cmd.CommandText = "select * from [项目]"
Else
cmd.CommandText = "select * from [项目] where 项目 Like ' % ' " & str & " ' %' "
End If
dst.DataTable = cmd.ExecuteReader()
dst.Build()
看看上面这行代码....注红色的到底要怎么样才正确?为何不能正确执行? 为了方便查看,我故意拉开标点符号距离...
改成这样也不行:
Like '*" & str & "*'
[此贴子已经被作者于2009-1-16 21:09:19编辑过]
关于这个,帮助有详细说明
应该是cmd.CommandText = "select * from [项目] where 项目
Like ' %" & str & " %' "