Server Error in '/' Application 发生错误,指高手指点

weihanmingwhmwhm 2010-10-09 02:15:41
Server Error in '/' Application.
--------------------------------------------------------------------------------

将截断字符串或二进制数据。
语句已终止。
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: 将截断字符串或二进制数据。
语句已终止。

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[SqlException (0x80131904): 将截断字符串或二进制数据。
语句已终止。]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +857434
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +735046
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1838
System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +31
System.Data.SqlClient.SqlDataReader.get_MetaData() +62
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +297
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +886
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +132
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +32
System.Data.SqlClient.SqlCommand.ExecuteScalar() +137
BlueCrystal.Data.DbHelper.ExecuteScalar(DbCommand cmd) +186
BlueCrystal.Data.DbProvider.ExecuteScalar(DbCommand cmd, DbTran tran) +34
BlueCrystal.Data.DbProvider.Insert(Entity entity, DbTran tran) +348
BlueCrystal.Data.DbBatch.Save(Entity entity, Boolean update) +174
BlueCrystal.Data.DbBatch.Save(EntityType entity) +21
BlueCrystal.Data.DbTran.Save(EntityType entity) +59
BlueCrystal.Data.DbSession.Save(EntityType entity) +59
NSW.Web.Manager.news_edit.SaveObject() +88
NSW.Web.UI.AdminPage.ActionEditorButton_Click(Object sender, EventArgs e, String objectName, DeliBindBatch deliSaveObject) in D:\网站项目\服务站\project_Youwejiaju_web\projects\Oran.OSite\UI\Page.cs:1777
NSW.Web.Manager.news_edit.btnSubmit_Click(Object sender, EventArgs e) +115
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
...全文
489 31 打赏 收藏 转发到动态 举报
写回复
用AI写文章
31 条回复
切换为时间正序
请发表友善的回复…
发表回复
weihanmingwhmwhm 2010-10-14
  • 打赏
  • 举报
回复
谢谢各位帮忙,最终解决了,是我传少了一个文件。唉,我明明从服务器复制下来的站点,结果解压出来不去,难道是DLL运行。
wangjinlong 2010-10-09
  • 打赏
  • 举报
回复
把问题简单化,做一个简单的写入模块,别的都去掉,或都输出sql,复制到查询分析器里执行一下看看,注意数据库对不,本地还是远程。
weihanmingwhmwhm 2010-10-09
  • 打赏
  • 举报
回复
[Quote=引用 28 楼 xushiyun 的回复:]
是你的数据长度不够 你的SQL插入语句有个字段的长度和你要插入的数据长度不够 一般都是你的SQL语句某个字段定义的长度小了 在插入时 SQL自动会截掉后面的 你要把SQL语句的那个字段的长度定义长点就好了 以前我也遇到个这个问题 我用的存储过程 SQL语句是正常的 但是就是插不进去 都是这个原因
[/Quote]

可以贴出你上次解决的代码给我看看吗?
仙儿 2010-10-09
  • 打赏
  • 举报
回复
是你的数据长度不够 你的SQL插入语句有个字段的长度和你要插入的数据长度不够 一般都是你的SQL语句某个字段定义的长度小了 在插入时 SQL自动会截掉后面的 你要把SQL语句的那个字段的长度定义长点就好了 以前我也遇到个这个问题 我用的存储过程 SQL语句是正常的 但是就是插不进去 都是这个原因
weihanmingwhmwhm 2010-10-09
  • 打赏
  • 举报
回复
[Quote=引用 21 楼 ghost_khz 的回复:]
数据库字段类型跟你语句里面的字段类型不一样?

比如varchar的搞成int了。 。。
[/Quote]

有些人说的.net 2.0权限不够,我自从安装了.net 3.5后,又重装回.net 2.0就这样子了。
weihanmingwhmwhm 2010-10-09
  • 打赏
  • 举报
回复
[Quote=引用 23 楼 shichao102471077 的回复:]
数据库中的字段长度不够。
[/Quote]

谢谢,我都看了一天,都乱了,好烦
weihanmingwhmwhm 2010-10-09
  • 打赏
  • 举报
回复
[Quote=引用 24 楼 net_lover 的回复:]
贴你插入数据的代码
[/Quote]

代码太长,贴不上,
孟子E章 2010-10-09
  • 打赏
  • 举报
回复
贴你插入数据的代码
shichao102471077 2010-10-09
  • 打赏
  • 举报
回复
数据库中的字段长度不够。
shichao102471077 2010-10-09
  • 打赏
  • 举报
回复
这个是你的插入字段是字符过长。调试下。。
Ghost_Khz 2010-10-09
  • 打赏
  • 举报
回复
数据库字段类型跟你语句里面的字段类型不一样?

比如varchar的搞成int了。 。。
weihanmingwhmwhm 2010-10-09
  • 打赏
  • 举报
回复
[Quote=引用 19 楼 miaochuanwei 的回复:]
引用 18 楼 weihanmingwhmwhm 的回复:
引用 11 楼 net_lover 的回复:
你怎么试的?你的内容是什么?



随便加一个12345标题提交就出现错误

估计不是你提交的内容引起的错误,应该是你提交时还操作了其他的数据表,比如一些记录操作日志的表等等,建议你单点调试一下看看程序执行到哪一步 出的错误。
[/Quote]


老大,可以说详细一点哦
臭写代码的 2010-10-09
  • 打赏
  • 举报
回复
[Quote=引用 18 楼 weihanmingwhmwhm 的回复:]
引用 11 楼 net_lover 的回复:
你怎么试的?你的内容是什么?



随便加一个12345标题提交就出现错误
[/Quote]
估计不是你提交的内容引起的错误,应该是你提交时还操作了其他的数据表,比如一些记录操作日志的表等等,建议你单点调试一下看看程序执行到哪一步 出的错误。
weihanmingwhmwhm 2010-10-09
  • 打赏
  • 举报
回复
[Quote=引用 11 楼 net_lover 的回复:]
你怎么试的?你的内容是什么?
[/Quote]


随便加一个12345标题提交就出现错误
weihanmingwhmwhm 2010-10-09
  • 打赏
  • 举报
回复
[Quote=引用 15 楼 abcjun188 的回复:]
你插入的是哪张表?把那张表 可能不够长 的字段 加长 就OK了
[/Quote]
不是的,数据库都是分开的。
臭写代码的 2010-10-09
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 weihanmingwhmwhm 的回复:]
引用楼主 weihanmingwhmwhm 的回复:
Server Error in '/' Application.
--------------------------------------------------------------------------------

将截断字符串或二进制数据。
语句已终止。
Description: An unhandled excep……
[/Quote]
这几个站点用的是一个库吗?
打一壶酱油 2010-10-09
  • 打赏
  • 举报
回复
你插入的是哪张表?把那张表 可能不够长 的字段 加长 就OK了
XiuJuan584868710 2010-10-09
  • 打赏
  • 举报
回复
过来看看!
Hertz_liu 2010-10-09
  • 打赏
  • 举报
回复
长度溢出了
孟子E章 2010-10-09
  • 打赏
  • 举报
回复
你怎么试的?你的内容是什么?
加载更多回复(10)

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧