Click here to Skip to main content
15,904,023 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

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
 
Share this answer
 
Comments
WCornelius224 29-Jun-11 23:32pm    
Peter thanks for that. I have Looked at that line repeatedly though and can't figure out why it isn't working now but was earlier in the life of the project.

That particular line is:

this.tableAdapterManager.UpdateAll(this._MyDatabase_1DataSet);

I am new to C#. I have been studying C++. I am familiar with some of the overall concepts but the mechanics are a little unfamiliar. Do you have any other suggestions?
Peter_in_2780 30-Jun-11 0:06am    
The problem is that "Date of Unit Sold" is not a valid column name. It is obviously being referenced for the first time by your UpdateAll() call, but the actual problem will be elsewhere. As a wild guess, a capitalisation problem in your table/column definitions? Or maybe a trailing space (looking at your error message).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900