按下我的“保存"按钮时出现C#异常 [英] C# Exception when hitting my save button

查看:83
本文介绍了按下我的“保存"按钮时出现C#异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如我最近发布的那样,我正在尝试为我工作的公司开发自己的程序.我已经在这方面取得了一些重大进展.我现在得到这个:

未处理System.Data.SqlServerCe.SqlCeException
Message =列名无效. [节点名称(如果有)=,列名称=售出日期]
Source = SQL Server Compact ADO.NET数据提供程序
HResult = -2147467259
NativeError = 25503
StackTrace:
在WindowsFormsApplication1._MyDatabase_1DataSetTableAdapters.TableAdapterManager.UpdateAll(_MyDatabase_1DataSet dataSet)中的C:\ Users \ Squishy \ Visual C#程序教程\ Dons App开始构建\ Dons App开始构建\ _MyDatabase_1DataSet.Designer.cs:line 1701 在WindowsFormsApplication1.Form1.customerContactsBindingNavigatorSaveItem_Click(Object sender,EventArgs e)中的C:\ Users \ Squishy \ Visual C#程序教程\ Dons App开始构建\ Dons App开始build \ Form1.cs:第40行
在System.Windows.Forms.ToolStripItem.RaiseEvent(对象键,EventArgs e)处
在System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)处
在System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
在System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)中
在System.Windows.Forms.ToolStripItem.FireEventInteractive(满足EventArgs e,ToolStripItemEventType)的情况下
在System.Windows.Forms.ToolStripItem.FireEvent(满足EventArgs e,ToolStripItemEventType)的情况下
在System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
在System.Windows.Forms.Control.WmMouseUp上(消息和m,MouseButtons按钮,Int32单击)
在System.Windows.Forms.Control.WndProc(Message& m)中
在System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在System.Windows.Forms.ToolStrip.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原因,Int32 pvLoopData)
在System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32原因,ApplicationContext上下文)中
在System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32原因,ApplicationContext上下文)
在System.Windows.Forms.Application.Run(Form mainForm)处
在WindowsFormsApplication1.Program.Main()中的C:\ Users \ Squishy \ Visual C#程序教程\ Dons App Start build \ Dons App Start build \ Program.cs:第18行
在System.AppDomain._nExecuteAssembly(RuntimeAssembly程序集,String [] args)中
在System.AppDomain.nExecuteAssembly(RuntimeAssembly程序集,String [] args)中
在System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
在System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
在System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext,String [] activationCustomData)
在System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
在System.Activator.CreateInstance(ActivationContext activationContext)处
在Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
在System.Threading.ThreadHelper.ThreadStart_Context(对象状态)处
在System.Threading.ExecutionContext.Run(ExecutionContext执行上下文,ContextCallback回调,对象状态,布尔值ignoreSyncCtx)处
在System.Threading.ExecutionContext.Run(ExecutionContext执行上下文,ContextCallback回调,对象状态)处
在System.Threading.ThreadHelper.ThreadStart()处
InnerException:


我不知道该怎么做才能解决此问题,并且想知道是否有人知道我可以解决该问题.

As I recently posted I am trying to develop my own program for the company that I work for. I have made some major progress in it. I am now getting this:

System.Data.SqlServerCe.SqlCeException was unhandled
Message=The column name is not valid. [ Node name (if any) = ,Column name = Date of Unit Sold ]
Source=SQL Server Compact ADO.NET Data Provider
HResult=-2147467259
NativeError=25503
StackTrace:
at WindowsFormsApplication1._MyDatabase_1DataSetTableAdapters.TableAdapterManager.UpdateAll(_MyDatabase_1DataSet dataSet) in C:\Users\Squishy\Visual C# Program Tutorials\Dons App Start build\Dons App Start build\_MyDatabase_1DataSet.Designer.cs:line 1701
at WindowsFormsApplication1.Form1.customerContactsBindingNavigatorSaveItem_Click(Object sender, EventArgs e) in C:\Users\Squishy\Visual C# Program Tutorials\Dons App Start build\Dons App Start build\Form1.cs:line 40
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsFormsApplication1.Program.Main() in C:\Users\Squishy\Visual C# Program Tutorials\Dons App Start build\Dons App Start build\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:


I have no idea what I did to create this problem and was wondering if anyone knew what I could do to fix it.

推荐答案

好.让我们在上面翻阅您的转储.

1.您得到了System.Data.SqlServerCe.SqlCeException
2.抱怨The column name is not valid. .... Column name = Date of Unit Sold
3.引发异常的呼叫来自....\_MyDatabase_1DataSet.Designer.cs:line 1701
4.依次从....\Dons App Start build\Form1.cs:line 40
调用
这些应该足以让您开始寻找问题的线索.
太难了吗?

彼得
OK. Let''s walk through your dump above.

1. You got System.Data.SqlServerCe.SqlCeException
2. It''s complaining that The column name is not valid. .... Column name = Date of Unit Sold
3. The call that raised the exception came from ....\_MyDatabase_1DataSet.Designer.cs:line 1701
4. That, in turn, was called from ....\Dons App Start build\Form1.cs:line 40

Those should be enough clues for you to start looking for the problem.
Is that too hard?

Peter


这篇关于按下我的“保存"按钮时出现C#异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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