Here is my code:
UVCUpdate update = new UVCUpdate(); update.CurrentDate = DateTime.Now; _context.UVCUpdates.Add(update); _context.SaveChanges();
Now I get an internal exception by saying this:
Cannot insert a NULL value in the column "CurrentDate", table "bLinked.dbo.BlackbookUpdateUVC"; column does not allow zeros. INSERT does not work.
If I print DateTime.Now right before this code, it produces:
11/15/2016 7:26:35 PM
My data type for CurrentDate in db is set to datetime, and in the class is DateTime. Not to allow null, but DateTime.Now should not have a null value?
, " " EF . Identity Computed - , EF , , INSERT UPDATE. NULL , - , .
, , . Leopard.
, UVCUpdate, , , , [DatabaseGenerated(DatabaseGeneratedOption.Identity)] CurrentDate. , , SQL, SQL , , null. CurrentDate , ...
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
Source: https://habr.com/ru/post/1654692/More articles:How to build two complex doubles with 256-bit AVX vectors? - cБудет ли приложение, построенное со старой версией Swift, иметь возможность неограниченно жить в магазине приложений? - ioscalculation of hazard function in R for standard normal distribution - standardshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1654690/how-to-make-the-gx-command-work-for-urls-in-vim-on-xfce4-desktop&usg=ALkJrhg5Xqa9PpvSb3bwDYT1inpD5enLNgHow to make a series of DialogFragments. One closes, the other opens automatically? - androidЗначение, принудительное к & str из && str, имеет нулевые значения для голого металла - rustStrange UIScrollView behavior in XCODE 8 without autorun - swift.dockerignore all subfolders, but not the files in the folder itself - gitGrouping R-frame by related values - rПочему [].concat() быстрее, чем Array.prototype.concat()? - performanceAll Articles