每当我有
Dim catID as integer
我在这样的查询中使用它:
cmd.CommandText = "select * from categories where parentid='" + catID + "'"
I get:
从字符串转换select * from categories where p
输入Double
无效。
为什么会这样呢?
The parentid
sql中的数据类型是integer
.
Try
cmd.CommandText = string.Format("select * from categories where parentid='{0}'", catID)
if parentid
是数据库中的数字字段,那么您需要
cmd.CommandText = string.Format("select * from categories where parentid={0}", catID)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)