Why this is happening?

`-

----------------------------
[General Info]

Application: SambaPOS
Version:     4.1.82
Region:      en
DB:          CE
Machine:     MOHIT
User:        Mohit
Date:        01-11-2015
Time:        11:09

User Explanation:

Mohit said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.Data.SqlServerCe.SqlCeException
Message:     The key cannot be deleted. The key to be deleted is already deleted from an index by another concurrent session.
Source:      SQL Server Compact ADO.NET Data Provider
Stack Trace: at System.Data.SqlServerCe.SqlCeCommand.ProcessResults(Int32 hr)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommandText(IntPtr& pCursor, Boolean& isBaseTableCursor)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteCommand(CommandBehavior behavior, String method, ResultSetOptions options)
   at System.Data.SqlServerCe.SqlCeCommand.ExecuteNonQuery()
   at System.Data.Objects.ObjectContext.ExecuteStoreCommand(String commandText, Object[] parameters)
   at Samba.Infrastructure.Data.SqlData.EFWorkspace.ExecSql(String sql)
   at Samba.Persistance.Data.Executor.ExecSqlCommand(String commandText, Object[] parameters)
   at Samba.Addon.DatabaseTools.DatabaseTaskManager.ExecuteTask(String taskType, String filePath, String arguments)
   at Samba.Addon.DatabaseTools.DatabaseTaskManager.ExecuteTask(DatabaseTask task, Boolean skipConfirmation)
   at Samba.Addon.DatabaseTools.DatabaseToolsViewModel.OnExecuteDatabaseTask(String obj)
   at Microsoft.Practices.Prism.Commands.DelegateCommand`1.<>c__DisplayClass6.<.ctor>b__2(Object o)
   at Microsoft.Practices.Prism.Commands.DelegateCommandBase.Execute(Object parameter)
   at Microsoft.Practices.Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)
   at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at Samba.Presentation.App.Main()

-----------------------------

[Assembly Info]

Samba.Services, Version=1.0.0.0
mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Samba.Infrastructure.Data, Version=1.0.0.0
PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
FluentValidation, Version=3.4.0.0
Samba.Domain, Version=1.0.0.0
DevExpress.Xpf.Grid.v14.1, Version=14.1.6.0
DevExpress.Xpf.Grid.v14.1.Core, Version=14.1.6.0
PresentationCore, Version=4.0.0.0
Stateless, Version=1.0.0.0
System.Core, Version=4.0.0.0
System.Drawing, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.6.0
EntityFramework, Version=4.4.0.0
System.Windows.Forms, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
Microsoft.CSharp, Version=4.0.0.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Persistance, Version=1.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
PropertyTools, Version=2012.4.14.1

-----------------------------

[System Info]

Operating System
-Microsoft Windows 8.1 Single Language
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = 330
--FreePhysicalMemory = 13061092
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 6.3.9600

Machine
-MOHIT
--Manufacturer = Hewlett-Packard
--Model = HP ENVY Notebook
--TotalPhysicalMemory = 17091145728
--UserName = Mohit\MOHIT\Mohit

-----------------------------

`

@JTRTech Please help :grin:

I would say because you rising CE (compact edition) for your database which I don’t think d database tools is posible for.
Pretty sure you need to use localDB for normal SQL database for that.

I use it daily…to reset token no and database transactions…I m afraid how I will be able to do it now :astonished:
It happened just after I completed my task to get the customer name thing…as discussed earlier

You have been using it before?

I did say I wasn’t sure if that was the reason.

Yes I always clear my database transaction every morning… I did it today morning also…But after making a print invoice button with ticket tag,I am not able to clear it

Can’t see how that would effect database tools.

Would recommend you convert to SQL either way.

Why do you clear transactions every day?

Try this…

Extract zip & Replace [MyDocuments]\SambaPOS5\Database Task\[CBL]Clear Database Transactions.sql file with this one.

[CBL]Clear Database Transactions.zip (472 Bytes)

1 Like

@emre same is coming after replacing this also :confounded:

What else can be the substitute ?

If you were using SQL you could run the script directly in SQL manager but you have no direct access to database in CompactEdition.

Would reconmend you switch to SQL either way.

can you zip & PM me your sdf file?

I am mailing to you that file…Please tell me your email

I have mailed it to you !

Another CE bug. Normally SQL CE expected to generate sequential unique id numbers for tickets. For a reason you have multiple tickets that have same Id number and it don’t allow deleting them. I quickly searched google but couldn’t find a working solution. Migrating to SQL Server Local DB sounds like the only option.

1 Like

How to do that ??? @emre

Try a quick forum search, one of the top hits is a great tutorial from kendash which I often refer to when seting up a new system to make sure I remembered everything.

1 Like