Hi,
Thanks so much for your awesome database engine! I'm having a problem and I am really hoping someone can help. I am getting a "Concurrency Violation" when I try to update a row in my table. I have built a sample app to demonstrate the problem - it is a Visual Studio 2008 project using the latest build of System.Data.SQLite. When I debug the program - hit the "Start" button on the form - I get the message below, and I really am not sure why. Any help is greatly appreciated! Please see "testapp.zip" which is attached to this post.
System.Data.DBConcurrencyException was unhandled
Message="Concurrency violation: the UpdateCommand affected 0 of the expected 1 records."
Source="System.Data"
RowCount=1
StackTrace:
at System.Data.Common.DbDataAdapter.UpdatedRowStatusErrors(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[ batchCommands, Int32 commandCount)
at System.Data.Common.DbDataAdapter.UpdatedRowStatus(RowUpdatedEventArgs rowUpdatedEvent, BatchCommandInfo[ batchCommands, Int32 commandCount)
at System.Data.Common.DbDataAdapter.Update(DataRow[ dataRows, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
at SQLiteTestApp.Form1.btnStart_Click(Object sender, EventArgs e) in C:\Users\Mike\Documents\Visual Studio 2008\Projects\SQLiteTestApp\SQLiteTestApp\Form1.cs:line 46
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.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(Int32 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 SQLiteTestApp.Program.Main() in C:\Users\Mike\Documents\Visual Studio 2008\Projects\SQLiteTestApp\SQLiteTestApp\Program.cs:line 17
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[ args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[ args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: