none
Sqlite Entity Framework RRS feed

  • Soru

  • Merhaba,

    Sqlite Entity Framework öğrenmeye çalışıyorum. ufak bir insert işlemi yapmaya çalıştım ancak bu hatayı aldım acaba sebebi nedir yardımcı olsursanız sevinirim.

    27 Aralık 2015 Pazar 13:55

Yanıtlar

Tüm Yanıtlar

  • Asıl hata mesajı InnerException da yazıyormuş. Ordaki hata mesajını yazabilir misin?

    Her şeyi denediğin halde yapamadıysan henüz denemediğin şeyler var demektir.

    27 Aralık 2015 Pazar 14:13
  • Id Idendtity  ie kendin girmeye çalışınca hata veriyor olabilir ve null olmaması gereken bir değeri null giriyorsa veya fk ise olmayan bir fk giriyor isen de o hatayı veriyor olabilir
    27 Aralık 2015 Pazar 14:16
  • Asıl hata mesajı InnerException da yazıyormuş. Ordaki hata mesajını yazabilir misin?

    Her şeyi denediğin halde yapamadıysan henüz denemediğin şeyler var demektir.

    System.Data.Entity.Infrastructure.DbUpdateException was unhandled
      HResult=-2146233087
      Message=An error occurred while updating the entries. See the inner exception for details.
      Source=EntityFramework
      StackTrace:
           konum: System.Data.Entity.Internal.InternalContext.SaveChanges()
           konum: System.Data.Entity.Internal.LazyInternalContext.SaveChanges()
           konum: System.Data.Entity.DbContext.SaveChanges()
           konum: WpfApplication2.MainWindow.button_Click(Object sender, RoutedEventArgs e) C:\Users\ensar\Documents\Visual Studio 2015\Projects\WpfApplication2\WpfApplication2\MainWindow.xaml.cs içinde: satır 35
           konum: System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
           konum: System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
           konum: System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
           konum: System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
           konum: System.Windows.Controls.Primitives.ButtonBase.OnClick()
           konum: System.Windows.Controls.Button.OnClick()
           konum: System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
           konum: System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
           konum: System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
           konum: System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
           konum: System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
           konum: System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
           konum: System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
           konum: System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
           konum: System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
           konum: System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
           konum: System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
           konum: System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
           konum: System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
           konum: System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
           konum: System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
           konum: System.Windows.Input.InputManager.ProcessStagingArea()
           konum: System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
           konum: System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
           konum: System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
           konum: System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           konum: System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           konum: MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
           konum: MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
           konum: System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
           konum: System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
           konum: System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
           konum: MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
           konum: MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
           konum: System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
           konum: System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
           konum: System.Windows.Application.RunDispatcher(Object ignore)
           konum: System.Windows.Application.RunInternal(Window window)
           konum: System.Windows.Application.Run(Window window)
           konum: System.Windows.Application.Run()
           konum: WpfApplication2.App.Main() C:\Users\ensar\Documents\Visual Studio 2015\Projects\WpfApplication2\WpfApplication2\obj\Debug\App.g.cs içinde: satır 0
           konum: System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
           konum: System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           konum: Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           konum: System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           konum: System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           konum: System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
           konum: System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           konum: System.Threading.ThreadHelper.ThreadStart()
      InnerException:
           HResult=-2146233087
           Message=An error occurred while updating the entries. See the inner exception for details.
           Source=EntityFramework
           StackTrace:
                konum: System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
                konum: System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.<Update>b__2(UpdateTranslator ut)
                konum: System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update[T](T noChangesResult, Func`2 updateFunction, Boolean throwOnClosedConnection)
                konum: System.Data.Entity.Core.EntityClient.Internal.EntityAdapter.Update(Boolean throwOnClosedConnection)
                konum: System.Data.Entity.Core.Objects.ObjectContext.<SaveChangesToStore>b__33()
                konum: System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
                konum: System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy)
                konum: System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClass28.<SaveChanges>b__25()
                konum: System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1 operation)
                konum: System.Data.Entity.Core.Objects.ObjectContext.SaveChanges(SaveOptions options)
                konum: System.Data.Entity.Internal.InternalContext.SaveChanges()
           InnerException:
                HResult=-2146232005
                Message=An error occurred while preparing the command definition. See the inner exception for details.
                Source=EntityFramework
                StackTrace:
                     konum: System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.CreateCommand(DbModificationCommandTree commandTree)
                     konum: System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.CreateCommand(Dictionary`2 identifierValues)
                     konum: System.Data.Entity.Core.Mapping.Update.Internal.DynamicUpdateCommand.Execute(Dictionary`2 identifierValues, List`1 generatedValues)
                     konum: System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.Update()
                InnerException:
                     HResult=-2146233067
                     Message=Unable to update the EntitySet 'tablo' because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation.
                     Source=System.Data.SQLite.EF6
                     StackTrace:
                          konum: System.Data.SQLite.EF6.DmlSqlGenerator.ExpressionTranslator.Visit(DbScanExpression expression)
                          konum: System.Data.Entity.Core.Common.CommandTrees.DbScanExpression.Accept(DbExpressionVisitor visitor)
                          konum: System.Data.SQLite.EF6.DmlSqlGenerator.GenerateInsertSql(DbInsertCommandTree tree, List`1& parameters)
                          konum: System.Data.SQLite.EF6.SqlGenerator.GenerateSql(SQLiteProviderManifest manifest, DbCommandTree tree, List`1& parameters, CommandType& commandType)
                          konum: System.Data.SQLite.EF6.SQLiteProviderServices.CreateCommand(DbProviderManifest manifest, DbCommandTree commandTree)
                          konum: System.Data.SQLite.EF6.SQLiteProviderServices.CreateDbCommandDefinition(DbProviderManifest manifest, DbCommandTree commandTree)
                          konum: System.Data.Entity.Core.Common.DbProviderServices.CreateDbCommandDefinition(DbProviderManifest providerManifest, DbCommandTree commandTree, DbInterceptionContext interceptionContext)
                          konum: System.Data.Entity.Core.Common.DbProviderServices.CreateCommandDefinition(DbCommandTree commandTree, DbInterceptionContext interceptionContext)
                          konum: System.Data.Entity.Core.Common.DbProviderServices.CreateCommand(DbCommandTree commandTree, DbInterceptionContext interceptionContext)
                          konum: System.Data.Entity.Core.Mapping.Update.Internal.UpdateTranslator.CreateCommand(DbModificationCommandTree commandTree)
                     InnerException:
    27 Aralık 2015 Pazar 18:12
  • Tabloda primary key olmayabilir mi?

    Her şeyi denediğin halde yapamadıysan henüz denemediğin şeyler var demektir.

    • Yanıt Olarak İşaretleyen Ensar KARTAL 27 Aralık 2015 Pazar 19:43
    27 Aralık 2015 Pazar 19:11
  • Bazen kör oluyor insan. Teşekkürler.
    27 Aralık 2015 Pazar 19:43