无效的 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 + "'"; 在asp页面绑定数据 如何制作这样的calender控件? 在本地计算机上使用.NET的WEB页面做一个MSMQ的接收程序 IIS不能连接,说是找不到路径 帮个忙现在急用!!!!!! 那里有功能全的C#论坛源码 树形控件 asp.net编程中button位置问题 在.NET中一般怎么设计类呀? asp.net中gridview单击button,传出值的问题 [提问]请问如何实现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 + "'";