Skip to main content

Posts

EF error: OriginalValues cannot be used for entities in the Added state

Problem : OriginalValues cannot be used for entities in the Added state I was working on a repository and came across an interesting, cryptic error that resulted from a fairly simple operation: Saving the changes. Without getting into code details (which are  irrelevant to the point), the call to the following statement failed: Context.SaveChanges(); The error message read: OriginalValues cannot be used for entities in the Added state When saving new entries to a SQL Server database using the Entity Framework, I came across the following exception error: OriginalValues cannot be used for entities in the Added state There may be a number of reasons why the exception was raised but I found that in my case I had to check the data I was trying to save to make sure that values were specified for all the fields and that the fields were in the ranges required by the SQL Server database. Here is a list of the checks I had to implement before writing the data to t...

jNotify Example for Disply animated boxes (information, errors, success) in asp.net

jNotify : Disply animated boxes (informations, errors, success) in just one line of code jNotify  can display information boxes in just one line of code in asp.net . Three kind of boxes are allowed :  information, success and failure. The whole box is entirely skinnable with css. For example, you could use it for a mail being successfully sent or a validation error of a form , or alert message . Previous post  Show jQuery UI Dialog Popup Window from Server Side ( Code Behind ) in ASP.Net First download  JNotify from GitHub   Implementations   Add links to master page , copy images into your folder  <link href="Styles/jNotify.jquery.css" rel="stylesheet" type="text/css" />   <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>   <script src="Scripts/jNotify.jquery.min.js" type="text/javascript"></script> Master page look like ...

Microsoft's New Plan To Make People Love Windows 8 Is Starting To Work- Holy Grail app development

When it comes to Windows 8 and Windows Phone, Microsoft has been caught in a Catch-22. People buy devices for the apps. Developers only want to write apps for devices that already have a lot of users. Microsoft has to convince app developers to write for Windows, not just iOS and Android, in order to sell more devices. This week during its developer conference, the company unveiled a grand strategy to break the stalemate. It announced a plan to deliver what's known as the "Holy Grail" of app development: write the app once and it runs on everything, Windows 8 devices, Windows Phone 8, Xbox, iOS and Android. Microsoft's plan consisted of lots of new development software, updates to existing software and new features in its app-hosting cloud Azure. Plus, Microsoft also launched a new software foundation that will bring even more "Holy Grail" tools to app developers, for free. Many people who attended the conference liked what they heard. A lot. Busin...