MS伙计们... BUG? [英] MS Guys... BUG?

查看:85
本文介绍了MS伙计们... BUG?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


这篇文章是针对潜伏在这里的MS人员。我有一个问题,一直在养它丑陋的头,我无法解决它。

20次中有19次我对存储过程的调用没有问题。但是每隔一段时间我就会得到一条消息,说明"System.InvalidOperationException发生了
Message = "所需的列'PeopleId'在结果中不存在。"
Source =" System.Data.Linq"
StackTrace:
System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderBase`1.GetColumnOrdinals(NamedColumn [] namedColumns)"

PeopleId是我的表中的主键,它是一个uniqueidentifier。发生此错误时,如果没有发生此异常,我将无法再调用数据上下文类。在开始使用数据上下文类之前,我必须停止ASP.NET Development Server并再次开始调试。

就像我说的那样,这是一个RANDOM事件。我不是每次都会发生的。

这是完整的调用堆栈:

System.Data.Linq.dll!System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderBase< System .__ Canon> .GetColumnOrdinals(System.Data。 Linq.SqlClient.ObjectReaderCompiler.NamedColumn [] namedColumns)+ 0x124 bytes

System.Data.Linq.dll!System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderBase< System .__ Canon> .ObjectReaderBase(System.Data .Linq.SqlClient.ObjectReaderCompiler.ObjectReaderSession< System .__ Canon> session,System.Data.Linq.SqlClient.ObjectReaderCompiler.NamedColumn [] namedColumns,object [] globals,object [] arguments,int nLocals)+ 0x82 bytes
< BR> System.Data.Linq.dll System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderSession<!系统.__佳能> .CreateReader<系统.__佳能>(System.Func< System.Data.Linq.SqlClient.Implementation.ObjectMaterializer< System .__ Canon>,System .__ Canon> fnMaterialize = {Method = {Recruiting.Model.People Read_People(System.Data.Linq.Sql Client.Implementation.ObjectMaterializer`1 [System.Data.SqlClient.SqlDataReader])}},System.Data.Linq.SqlClient.ObjectReaderCompiler.NamedColumn [] namedColumns,object [] globals,int nLocals,bool disposeDataReader = true)+ 0x48 bytes

System.Data.Linq.dll!System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderFactory< System .__ Canon,System .__ Canon> .Create(System.Data.Common.DbDataReader dataReader,bool disposeDataReader, System.Data.Linq.SqlClient.IReaderProvider提供程序,object [] parentArgs,object [] userArgs,System.Data.Linq.SqlClient.ICompiledSubQuery [] subQueries)+ 0xbe bytes

System.Data.Linq.dll !System.Data.Linq.SqlClient.SqlProvider.Execute(System.Linq.Expressions.Expression query = {value(JobsDataContext).usp_people_getbyemailaddress(" test@testing1.com ")},System.Data.Linq.SqlClient.SqlProvider.QueryInfo queryInfo = {System.Data.Linq.SqlClient.SqlProvider.Que ryInfo},System.Data.Linq.SqlClient.IObjectReaderFactory factory,object [] parentArgs,object [] userArgs,System.Data.Linq.SqlClient.ICompiledSubQuery [] subQueries,object lastResult)+ 0x3a0 bytes

System .Data.Linq.dll!System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(System.Linq.Expressions.Expression query = {value(JobsDataContext).usp_people_getbyemailaddress(" test@testing1.com ")},System.Data.Linq.SqlClient.SqlProvider.QueryInfo [] queryInfos = {System.Data.Linq.SqlClient .SqlProvider.QueryInfo [1]},System.Data.Linq.SqlClient.IObjectReaderFactory factory = {System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderFactory< System.Data.SqlClient.SqlDataReader,Recruiting.Model.People>},object [] userArguments = null,System.Data.Linq.SqlClient.ICompiledSubQuery [] subQueries = {System.Data.Linq.SqlClient.ICompiledSubQuery [0]})+ 0x82 bytes

System.Data.Linq.dll !System.Data.L inq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(System.Linq.Expressions.Expression query)+ 0x36f bytes
System.Data.Linq.dll!System.Data.Linq.DataContext.ExecuteMethodCall (对象实例,System.Reflection.MethodInfo methodInfo,object []参数)+ 0x81字节

有时会出现此错误如果我让开发服务器在VS 2008中运行(在调试模式下)一段时间(10分钟),就会发生这种情况。



我显然无法调试此问题,因为我没有符号或源代码。

任何帮助将不胜感激。

解决方案

我怀疑服务器的实际回报有些奇怪。你能够验证你得到的回报吗?采用*完全相同的SQL命令*,如果直接使用ADO.NET,您会看到什么? (LINQ to SQL在内部使用ADO.NET)



您应该能够使用db获取SQL命令。 GetCommand(查询)。


 

This post is directed for the MS guys who lurk here. I have an issue that keeps rearing it's ugly head and I'm unable to fix it.

19 out of 20 times my call to a stored procedures works without issue. However every once in a while I'll get a message stating "System.InvalidOperationException occurred
  Message="The required column 'PeopleId' does not exist in the results."
  Source="System.Data.Linq"
  StackTrace:
       at System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderBase`1.GetColumnOrdinals(NamedColumn[] namedColumns)"

PeopleId is the primary key in my table which is a uniqueidentifier. When this error occurs I can no longer make any calls to the data context class without this exception occurring. I have to stop the ASP.NET Development Server and start debugging again before I can start using the data context class.

Like I said this is a RANDOM occurrence. I does not happen everytime.

Here is the full call stack:

  System.Data.Linq.dll!System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderBase<System.__Canon>.GetColumnOrdinals(System.Data.Linq.SqlClient.ObjectReaderCompiler.NamedColumn[] namedColumns) + 0x124 bytes 

  System.Data.Linq.dll!System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderBase<System.__Canon>.ObjectReaderBase(System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderSession<System.__Canon> session, System.Data.Linq.SqlClient.ObjectReaderCompiler.NamedColumn[] namedColumns, object[] globals, object[] arguments, int nLocals) + 0x82 bytes 

  System.Data.Linq.dll!System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderSession<System.__Canon>.CreateReader<System.__Canon>(System.Func<System.Data.Linq.SqlClient.Implementation.ObjectMaterializer<System.__Canon>,System.__Canon> fnMaterialize = {Method = {Recruiting.Model.People Read_People(System.Data.Linq.SqlClient.Implementation.ObjectMaterializer`1[System.Data.SqlClient.SqlDataReader])}}, System.Data.Linq.SqlClient.ObjectReaderCompiler.NamedColumn[] namedColumns, object[] globals, int nLocals, bool disposeDataReader = true) + 0x48 bytes 

  System.Data.Linq.dll!System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderFactory<System.__Canon,System.__Canon>.Create(System.Data.Common.DbDataReader dataReader, bool disposeDataReader, System.Data.Linq.SqlClient.IReaderProvider provider, object[] parentArgs, object[] userArgs, System.Data.Linq.SqlClient.ICompiledSubQuery[] subQueries) + 0xbe bytes 

  System.Data.Linq.dll!System.Data.Linq.SqlClient.SqlProvider.Execute(System.Linq.Expressions.Expression query = {value(JobsDataContext).usp_people_getbyemailaddress("test@testing1.com")}, System.Data.Linq.SqlClient.SqlProvider.QueryInfo queryInfo = {System.Data.Linq.SqlClient.SqlProvider.QueryInfo}, System.Data.Linq.SqlClient.IObjectReaderFactory factory, object[] parentArgs, object[] userArgs, System.Data.Linq.SqlClient.ICompiledSubQuery[] subQueries, object lastResult) + 0x3a0 bytes 

  System.Data.Linq.dll!System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(System.Linq.Expressions.Expression query = {value(JobsDataContext).usp_people_getbyemailaddress("test@testing1.com")}, System.Data.Linq.SqlClient.SqlProvider.QueryInfo[] queryInfos = {System.Data.Linq.SqlClient.SqlProvider.QueryInfo[1]}, System.Data.Linq.SqlClient.IObjectReaderFactory factory = {System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReaderFactory<System.Data.SqlClient.SqlDataReader,Recruiting.Model.People>}, object[] userArguments = null, System.Data.Linq.SqlClient.ICompiledSubQuery[] subQueries = {System.Data.Linq.SqlClient.ICompiledSubQuery[0]}) + 0x82 bytes 

  System.Data.Linq.dll!System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(System.Linq.Expressions.Expression query) + 0x36f bytes 
  System.Data.Linq.dll!System.Data.Linq.DataContext.ExecuteMethodCall(object instance, System.Reflection.MethodInfo methodInfo, object[] parameters) + 0x81 bytes 

Sometimes this error occurs if I leave the development server running in VS 2008 (in debug mode) for a while (10 minutes).


I obviously cannot debug this issue as I don't have the symbols or source code.

Any help would be appreciated.

解决方案

I'm suspecting some oddity in the actual returns from the server.  Are you able to verify the what you're getting back?  Taking the *exact same SQL commands*, what do you see if you use ADO.NET directly? (LINQ to SQL uses ADO.NET internally) 

 

You should be able to get the SQL command using db.GetCommand(query).


这篇关于MS伙计们... BUG?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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