一个奇怪的问题! [英] A strange problem!
问题描述
大家好;
我有一个奇怪的问题,那是一个使用VS2008的LINQ TO SQL和SQL Server 2005 Express作为我的两层实现的项目.这样,使用LINQ TO SQL的数据层就可以工作了.但是问题是,我每运行10次程序,运行一次错误大约3次且7次运行的程序就没有错误.例如,某些表单运行时会出现以下错误:
服务器无法恢复交易. Desc:3400000007
或运行以下命令:
Hello everyone;
I have a strange problem and that a project using LINQ TO SQL and SQL Server 2005 Express by VS2008 as my two-layer implementation. In this way the Data Layer with LINQ TO SQL worked. But the problem there is that every 10 times I run the program, the program with an error of about 3 times and 7 times runs without error. For example, some forms running time gives the following error:
The server failed to resume the transaction. Desc:3400000007
Or run the following command:
var q = from p in PData.Customers
select p.Custom_ID;
if (q.Count() != 0)
{
:.
}
q.Count()命令出现此错误:
指定的演员表无效.
问题是否出在LINQ上,有时是问题,还是其他地方的错误?
解决方案有人知道这个问题吗?
谢谢.
q.Count() command takes this error:
Specified cast is not valid.
Whether the problem is LINQ, which is sometimes a problem or bug is from somewhere else?
Solutions anyone knows this problem?
Thanks.
推荐答案
这一切都在您的ASP.Net页面中?
this is all in you ASP.Net page ?
var q = from p in PData.Customers
select p.Custom_ID;
if (q.Count() != 0)
{
:.
}
也许这是内存泄漏!尝试限制源代码以集中解决问题&监视您的PC内存.
关闭Server SQL并重新启动.
还尝试手动使用Connection.Open()/Close/()Connection.BeginTransaction/...(用于测试)
maybe this is a memory leak!try to limit source code for centralizing problem & monitor your PC memory.
shutdown Server SQL and restart.
also try to use manually Connection.Open()/Close/()Connection.BeginTransaction/... (for testing)
这篇关于一个奇怪的问题!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!