是否有可能更新按钮编写此代码.我在此代码中出现错误 [英] Is it posible to update button write this code. i am geting error in this code

查看:90
本文介绍了是否有可能更新按钮编写此代码.我在此代码中出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

               grdView.EditIndex = -1;
        ShowGridBindData();


}


我在这一行中遇到了错误daq.Fill(ds,"db");


I got Error in this line daq.Fill(ds, "db");

推荐答案

除了Anuj Banka所说的以外:您的SQL语句是由字符串串联组装的操作,因此容易受到SQL注入攻击.您的问题很可能是由以下事实引起的:在注释或标记内的某个地方存在一个单引号字符,这会破坏您幼稚地构造的SQL.使用 SqlCommand [参数 [ SqlParameter [
Apart from what Anuj Banka already stated: Your SQL statement is assembled by string concatenation operations and is thus prone to SQL injection attacks. Your problem most likely arises from the fact that somewhere inside a comment or a mark there is a single quote character which will corrupt your naively constructed SQL. Use the SqlCommand[^].Parameters[^] in conjunction with the SqlParameter[^] class.

Regards,

—MRB



您正在使用Update sql查询填充数据集,它将不会返回任何内容..
You are filling your dataset with Update sql query it will return you nothing..


这篇关于是否有可能更新按钮编写此代码.我在此代码中出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆