查询数据库时出了问题

委屈让法风烧饼 2016-04-15 12:27:07



未处理System.Data.EntityCommandExecutionException
HResult=-2146232004
Message=执行命令定义时出错。有关详细信息,请参阅内部异常。
Source=System.Data.Entity
StackTrace:
在 System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
在 System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
在 System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
在 System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
在 System.Data.Entity.Internal.Linq.InternalQuery`1.GetEnumerator()
在 System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator()
在 System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator()
在 System.Linq.Parallel.PartitionedDataSource`1.InitializePartitions(IEnumerable`1 source, Int32 partitionCount, Boolean useStriping)
在 System.Linq.Parallel.PartitionedDataSource`1..ctor(IEnumerable`1 source, Int32 partitionCount, Boolean useStriping)
在 System.Linq.Parallel.ExchangeUtilities.PartitionDataSource[T](IEnumerable`1 source, Int32 partitionCount, Boolean useStriping)
在 System.Linq.Parallel.ScanQueryOperator`1.ScanEnumerableQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient)
在 System.Linq.Parallel.UnaryQueryOperator`2.UnaryQueryOperatorResults.GivePartitionedStream(IPartitionedStreamRecipient`1 recipient)
在 System.Linq.Parallel.QueryOperator`1.GetOpenedEnumerator(Nullable`1 mergeOptions, Boolean suppressOrder, Boolean forEffect, QuerySettings querySettings)
在 System.Linq.Parallel.QueryOpeningEnumerator`1.OpenQuery()
在 System.Linq.Parallel.QueryOpeningEnumerator`1.MoveNext()
在 System.Linq.ParallelEnumerable.ToList[TSource](ParallelQuery`1 source)
在 WiseCloud.ITDS.Model.ProductDataSource.GetEnterpriseAllProduct(Int32 enterpriseId) 位置 d:\项目数据\导出程序资料\加西亚DM_140905_迁移6个加\ITDS\ITDSSln\WiseCloud.ITDS.Model\ProductDataSource.cs:行号 26
在 DataManage.Export.Export5Plus() 位置 d:\项目数据\导出程序资料\加西亚DM_140905_迁移6个加\DataManage\DataManage\Export.cs:行号 94
在 DataManage.MainForm.nbiExport_LinkClicked(Object sender, NavBarLinkEventArgs e) 位置 d:\项目数据\导出程序资料\加西亚DM_140905_迁移6个加\DataManage\DataManage\MainForm.cs:行号 153
在 DevExpress.XtraNavBar.NavBarItem.RaiseLinkEvent(Object linkEvent, NavBarItemLink link)
在 DevExpress.XtraNavBar.NavBarItem.RaiseLinkClicked(NavBarItemLink link)
在 DevExpress.XtraNavBar.NavBarItem.RaiseLinkClickedCore(NavBarItemLink link)
在 DevExpress.XtraNavBar.NavBarControl.RaiseLinkClicked(NavBarItemLink link)
在 DevExpress.XtraNavBar.ViewInfo.NavBarViewInfo.DoLinkClick(NavBarHitInfo hitInfo)
在 DevExpress.XtraNavBar.ViewInfo.NavBarViewInfo.DoClick(NavBarHitInfo hitInfo)
在 DevExpress.XtraNavBar.ViewInfo.NavigationPaneViewInfo.DoClick(NavBarHitInfo hitInfo)
在 DevExpress.XtraNavBar.ViewInfo.NavBarViewInfo.OnMouseUp(MouseEventArgs e)
在 DevExpress.XtraNavBar.NavBarControl.OnMouseUp(MouseEventArgs ev)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 DevExpress.XtraNavBar.NavBarControl.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(Form mainForm)
在 DataManage.Program.Main() 位置 d:\项目数据\导出程序资料\加西亚DM_140905_迁移6个加\DataManage\DataManage\Program.cs:行号 21
在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Data.SqlServerCe.SqlCeException
HResult=-2147467259
Message=列名无效。 [ Node name (if any) = Extent1,Column name = Note ]
Source=SQL Server Compact ADO.NET Data Provider
ErrorCode=-2147467259
NativeError=25503
StackTrace:
在 System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
在 System.Data.SqlServerCe.SqlCeCommand.CompileQueryPlan()
在 System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
在 System.Data.SqlServerCe.SqlCeCommand.ExecuteReader(CommandBehavior behavior)
在 System.Data.SqlServerCe.SqlCeMultiCommand.ExecuteReader(CommandBehavior behavior)
在 System.Data.SqlServerCe.SqlCeMultiCommand.ExecuteDbDataReader(CommandBehavior behavior)
在 System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior)
在 System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
InnerException:
...全文
232 5 打赏 收藏 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
人生导师 2016-04-16
  • 打赏
  • 举报
回复
首先看看其他查询是否有问题,没有的话,再具体调试这个查询错误,看看内部错误具体是什么?
江南小鱼 2016-04-15
  • 打赏
  • 举报
回复
说明q为null呗
範先森 2016-04-15
  • 打赏
  • 举报
回复
你看看你的sql语句是不是写错了
  • 打赏
  • 举报
回复
我的表不为空啊
  • 打赏
  • 举报
回复

62,270

社区成员

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

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

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

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