Running .net 2008, asp.net, Linq to sql, sql server 2008 express
Foo f = db.Foo.First(x => x.ID == id); f.IsValid = true; db.SubmitChanges();
I have a very simple table that has several fields and no FK restrictions. None of the data is saved when .SubmitChanges () is called, but an error does not occur. Any ideas?
Without using any explicit transaction area, fields are not generated automatically and triggers are not started on the server.
, , , - db.Log = Console.Out;, , - TSQL ( : SQL). , , IsValid - , ( ).
db.Log = Console.Out;
IsValid
, , , (db.ObjectTrackingEnabled).
db.ObjectTrackingEnabled
:
Complete()
TransactionScope
, IsValid db- ( )
IsValid f, x.
f
x
Complete TransactionScope, .
Complete
IsValid AutoGenerated ? , , , . , , DB, , , "", 0 (false)?
It turns out that the primary key has been deleted from the database since the last use of this application. When I recently updated .dbml, it was generated without a primary key. Adding this hotfix resolves the issue.
Source: https://habr.com/ru/post/1738052/More articles:How to add HTML next to the tag in Joomla module? - htmlDrupal 5: поля CCK в настраиваемом типе содержимого - viewsDetecting changes between rows with the same identifier - sqlпреобразование факторизованного числа в десятичный в SQL Server - sql-serverJavascript open window links - javascriptIs there any technique for rounding the image if the background is dynamic (not solid) keeping the image square jpeg? - cssCalling the core Java function - javadoesn't work for a loop - javaParagraph formatting in WPF RichTextBox? - wpfhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1738057/public-property-list-needs-to-concat-2-types-with-inheritance&usg=ALkJrhjAKKNTAvaKzbZzSo0XapuFwDvPowAll Articles