主机上的sqlserver中的datetime(iis) [英] datetime in sqlserver on host(iis)

查看:67
本文介绍了主机上的sqlserver中的datetime(iis)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi。



i在sql server 2008的表中有日期时间类型字段。

i将数据从.aspx插入到同一个表中。 cs代码。当我在visual studio中运行这个网站时它正确执行。但是当我从iis运行时,它不起作用并且它有这样的错误



String或二进制数据将被截断。声明已被终止。



i需要帮助来解决这个问题。

谢谢。

解决方案

由于您提供的信息量有限,这些是我的想法:



1.我知道这很傻,但有助于仔细检查。我希望你指向同一个数据库环境,包括Visual Studio和IIS。



2.你在Visual中使用的代码之间可能存在代码不匹配Studio v / s发布到IIS的代码(不太可能,但我不确定代码是什么样的)



3.在数据库上放一个SQL Profiler跟踪并查看正在通话中。



4.使用您通过探查器捕获的呼叫并尝试手动运行。



5.确定表格中的违规栏目。这应该相对容易,因为你提供的字符串长于列可以处理的字符串。



让我们看看这是怎么回事......

hi.

i have datetime type field in a table in sql server 2008.
i insert data to same table from .aspx.cs code .when i run this website in visual studio it execute correctly.but when i run from iis that dose not work and it has an error like this

"String or binary data would be truncated.The statement has been terminated. "

i need help for solving this problem.
thank you.

解决方案

With the limited amount of information you have supplied, these are my thoughts:

1. I know this is silly but it helps to double check. I hope you are pointing to the same database environment, both from Visual Studio and via IIS.

2. There could be a code mismatch between what you are using in Visual Studio v/s the code released to IIS (unlikely but I am not sure what the code looks like)

3. Put a SQL Profiler trace on the database and look at the call being made.

4. Use the call you have captured via profiler and try and run it manually.

5. Identify the offending column in the table. This should be relatively easy because you are supplying a string longer than what the column can handle.

Let''s see how this pans out...


这篇关于主机上的sqlserver中的datetime(iis)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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