When you are inserting into a table using entity framework, on rare occasions you might get the following error: {System.Data.OptimisticConc... Store update, insert, or delete statement affected an unexpected number of rows (0) This happened to me because of an "instead of INSERT" trigger that was active on the page. It turns out that EF does not go well with triggers, because it fails to get the inserted ID. For me, the solution was to change the trigger so that the last executed code ......

Restoring a database can be a pain in the ass, specially when you need to find some point in time where the data went wrong.This is the best way i know how:RESTORE DATABASE MY_TARGET_DATABASE FROM DISK = 'path_to_backup.bak' WITH NORECOVERY, replaceGORESTORE LOG MY_TARGET_DATABASE FROM DISK = 'mytransaction_log1.trn' WITH NORECOVERYGORESTORE LOG MY_TARGET_DATABASE FROM DISK = 'mytransaction_log2.trn' WITH NORECOVERYgoRESTORE LOG MY_TARGET_DATABASE FROM DISK = 'mytransaction_log3.trn' WITH NORECOVERYgoRESTORE ......

If you have a "{" or "}" inside a string when using string.format you will get the error mentioned in the title. To fix this you must double the charater. Error Example: string teste = string.Format(" This is a {teste} {0} ", mystring); Correct Example: string teste = string.Format(" This is a {{teste}} {0} ", mystring);v ......

In global.asax: protected void Application_BeginRequest(Ob... sender, EventArgs e) { HttpRuntimeSection runTime = (HttpRuntimeSection)WebConf... //Approx 100 Kb(for page content) size has been deducted because the maxRequestLength proprty is the page size, not only the file upload size int maxRequestLength = (runTime.MaxRequestLength - 100) * 1024; //This code is used to check the request length of the page and if the request length is greater than ......