Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:我被标点符号搞晕了(已解决)

1楼
菜鸟foxtable 发表于:2009/1/16 19:56:00
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编辑过]
2楼
kylin 发表于:2009/1/16 20:27:00
关于这个,帮助有详细说明
应该是cmd.CommandText = "select  * from [项目] where 项目 Like ' %" & str & " %' "
3楼
菜鸟foxtable 发表于:2009/1/16 20:31:00
图片点击可在新窗口打开查看原来多了个单引号....
共3 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01758 s, 2 queries.