SQL参数不影响SqlCommand(C#) [英] SQL Parameters Not Affecting SqlCommand (C#)

查看:72
本文介绍了SQL参数不影响SqlCommand(C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设一个SqlCommand对象具有有效的连接和SQL命令:

Assume an SqlCommand object with a valid connexion and SQL command of:

展开 | 选择 | Wrap | 行号

推荐答案

什么您的存储过程是什么样的?

如果出现问题,您似乎应该得到一个例外。

但是如果出现问题也可能出现问题WHERE子句在没有错误的情况下会失败。
What does your stored procedure look like?
It seems like you should be getting an exception if something was very wrong.
BUT it''s also possible if something goes wrong with the WHERE clause it will fail without an error.


你在哪里设置要由sqlcommand执行的查询?

Where are you setting the query to be executed by your sqlcommand?

展开 | 选择 | Wrap | 行号



您的存储过程是什么样的?

看起来你应该得到一个例外如果出现了什么问题。

但是如果WHERE子句出现问题也可以在没有错误的情况下失败。
What does your stored procedure look like?
It seems like you should be getting an exception if something was very wrong.
BUT it''s also possible if something goes wrong with the WHERE clause it will fail without an error.



不确定我理解你对存储过程的意思。这不是我提供的吗? (当然它适用于SQL,当然,没有一个,只是一个简单的查询。)


WHERE子句不太可能出错。请注意,Response.Redirect()依赖于@companyID要正确转发的相同变量。

Not sure I understand what you mean about the stored procedure. Isn''t that what I supplied? (And as it applies to SQL, of course, there isn''t one, being a simple query.)

It''s unlikely something''s wrong with the WHERE clause. Note that Response.Redirect() depends on the same variable @companyID does to be forwarded properly.


这篇关于SQL参数不影响SqlCommand(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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