无效的 SQL语句 string sql = "delele from hyb where id=‘ " + e.CommandArgument+“‘ “ ; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 =‘ " + e.CommandArgument+“‘ 单引号有问题吧,好像是中文模式下的. 1. ‘ 是全角的,要用半角的2. 最后少了一个双引号当然,如果是自动编号,就不应该用引号string sql = "delele from hyb where id=" + e.CommandArgument ; string sql = "delele from hyb where id=" + e.CommandArgument ;这样就可以了! 整型前后不能加单引号,这样:string sql = "delele from hyb where id=" + e.CommandArgument; jetsqldelete * from .. 另外你的语句里'是全角的.如果你的id是数字类型的.string sql = "delele * from hyb where id=" + e.CommandArgument;或者string sql = "delele * from hyb where id='" + e.CommandArgument + "'";都是可以的. delele改为delete 单词写错了···· 数字类型 用字串定界符 ' ' 是会隐式转换的.所以 delete * from tb where id='5'和delete * from tb where id=5没有区别但是如果id是文本类型的(含有不可转换为数字的值),那么必须使用字串定界符. 看看你的e.CommandArgument是否有值。 string sql = "delele from hyb where id=" + e.CommandArgument ; delete 不是delele 整型字段不加引号 ---> delete * from ???? 这也行? "delele from hyb where id=" + e.CommandArgument tds__609 近世进士尽是近视⊙-⊙ 等 级: 发表于:2008-01-29 13:18:2415楼 得分:0 ---> delete * from ???? 这也行? ----------------------标准jetsql语法DELETE [表.*] FROM 表 WHERE标准当然,不加*也是可以的. 印像中前些年用时,早期的不行.t-sql不能加* string sql = "delele from hyb where id=" + e.CommandArgument+“ ; string sql = "delele from hyb where id='"+e.CommandArgument+"'"; string sql = "delele from hyb where id="+e.CommandArgument+“ access数据库整型不要加单引号,改成delele from hyb where id=" + e.CommandArgument就可以了.sqlserver oracle加不加都可以. 1. ‘ 是全角的,要用半角的 2. 最后少了一个双引号 当然,如果是自动编号,就不应该用引号 string sql = "delele from hyb where id=" + e.CommandArgumen string sql = "delele from hyb where id=‘ " + e.CommandArgument+“‘ ; 单词错,单引号,双引号错 语句本身有问题!如果是accessdelete * from hyb where id= "+ e.CommandArgument+"//如果编号是不用单引号的,楼主少了个*号delete hyb where id="+ e.CommandArgument+"//这是SQl的语法 string sql="delete from hyb where id='"+e.CommandArgument+"'"; string sql = "delele from [hyb] where [id]='"+ e.CommandArgument +"'; string sql = "delele from hyb where id=" + e.CommandArgument; OR string sql = "delele from hyb where id='" + e.CommandArgument + "'"; jquery与后台的交互 关于用户控件的问题,有一疑问 XMLDOM的loadXML()方法总是失败 关于ASP。NET数据库依赖缓存 简单问题,有心者进! 简单问题:怎么在C#代码弹出一个新页 MyXls 导出数据到excel 在框架网页中如何实现在一个页面改变了,另一个也会自动改变?? 水晶报表问题,搞了一天了 小问题 [提问]请问如何实现igoogle中的页面自动读取功能 如何上传.net网站
2. 最后少了一个双引号
当然,如果是自动编号,就不应该用引号
string sql = "delele from hyb where id=" + e.CommandArgument ;
这样就可以了!
或者
string sql = "delele * from hyb where id='" + e.CommandArgument + "'";都是可以的.
和
delete * from tb where id=5
没有区别但是如果id是文本类型的(含有不可转换为数字的值),那么必须使用字串定界符.
---> delete * from ????
这也行?
近世进士尽是近视⊙-⊙
等 级:
发表于:2008-01-29 13:18:2415楼 得分:0 ---> delete * from ???? 这也行?
----------------------
标准jetsql语法DELETE [表.*]
FROM 表
WHERE标准当然,不加*也是可以的. 印像中前些年用时,早期的不行.t-sql不能加*
2. 最后少了一个双引号
当然,如果是自动编号,就不应该用引号
string sql = "delele from hyb where id=" + e.CommandArgumen
如果是accessdelete * from hyb where id= "+ e.CommandArgument+"
//如果编号是不用单引号的,楼主少了个*号delete hyb where id="+ e.CommandArgument+"
//这是SQl的语法
OR
string sql = "delele from hyb where id='" + e.CommandArgument + "'";