没有在查询中给出错误..... [英] not giving error in queries.....

查看:107
本文介绍了没有在查询中给出错误.....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在那里

在vb.net中,当我在查询中犯错误时,它没有给出错误.

hi there

in vb.net when i make mistakes in query then it''s not giving error.

so how can i know what is the mistake in my query.

推荐答案

这里的简单答案是没有抛出错误,或者您忽略了它.不要忘记VB.NET并没有验证您的SQL代码(大部分情况下).相反,SQL Server会这样做.因此,您将不会获得与代码中相同的错误事件.根据连接到SQL Server的方式,通常可以查询命令对象(我相信这是一个对象)以获取错误信息.

也不要忘记返回错误信息的SQL语句也不是错误.否则,它可能会起作用并且只是没有按照您的意愿去做.

我的建议是在SQL中运行所有查询,然后将它们复制到VB.NET.另外,使用存储过程,以便您可以对服务器进行简单的调用.
The simple answer here is that an error isn''t being thrown or you are ignoring it. Don''t forget that VB.NET isn''t validating your SQL code (for the most part). Instead, SQL Server is doing that. Therefore, you won''t get the same error events as you would in your code. Depending on how you are connecting to your SQL server, you can usually query the command object (I believe that is the one) to get error information.

Don''t forget too that a SQL statement that returns the wrong information isn''t an error. Otherwise it might be working and just not doing what you want it to do.

My suggestion is to run all queries in SQL and then copy them into VB.NET. Also, use Stored Procedures so you can make simple calls to the server.


这篇关于没有在查询中给出错误.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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