"/OPSmain1"应用程序中的服务器错误. [英] Server Error in '/OPSmain1' Application.

查看:75
本文介绍了"/OPSmain1"应用程序中的服务器错误.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,先生,

当我插入所有必填字段并通过按钮提交时,将显示此错误:"/OPSmain1"应用程序中的服务器错误.


< pre lang ="msil">字符串或二进制数据将被截断.
该语句已终止</pre>
.
代码:
第64行:cmd =新的SqlCommand(p,cn)
第65行:cmd.ExecuteNonQuery()----------------错误行
第66行:cn.Close()
第67行:Dim q As</pre>


请纠正或提出解决方案,让我尽快知道... ......< b></b>

Hello Sir ,

When I inserted all required fields and submitted via button this Error is displayed : Server Error in ''/OPSmain1'' Application.


<pre lang="msil">String or binary data would be truncated.
The statement has been terminated</pre>
.
Code :
Line 64: cmd = New SqlCommand(p, cn)
Line 65: cmd.ExecuteNonQuery()----------------Error Line
Line 66: cn.Close()
Line 67: Dim q As</pre>


Please rectify or solution let me know ASAP ......<b></b>

推荐答案

使用Try. Catch.块
捕获确切的错误.

您遇到的问题可能是我遇到了错误",但我们问的问题是您遇到了什么错误?"

然后进一步向我们展示,Devloper在这里将为您提供帮助.

错误行不能使我们清楚地知道您要得到什么确切的错误.
Use Try. Catch. Block
Catch the Exact Error.

The question for you may be ''I am getting Error'',but the question we ask you ''what Error you getting ?''

And then further show it to us, Devloper here will help you with that.

The error line doesn''t give us clear idea what exact error you are getting.


请参见下面的链接

http://www.sql-server-performance.com/faq/string_or_binary_data_truncated_p1.aspx

如果这对您有帮助,请投票.
Please see the below link

http://www.sql-server-performance.com/faq/string_or_binary_data_truncated_p1.aspx

If this helps you then please vote.


当您尝试插入的字符数超出列可容纳的最大字符数时,会出现此错误消息.
检查数据库中的字段长度.
This error message appears when you try to insert a string with more characters than the column can maximal accommodate.
Check the field lengths in the DB.


这篇关于"/OPSmain1"应用程序中的服务器错误.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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