Unable to update the EntitySet ” because it has a DefiningQuery and no <> element exists in the <> element to support the current operation.

Silly thing this. Found this link. In my case this was caused by not selecting the primary key for the table in SQL Server I was generating the entity set against and then attempting to call the Entity Framework AddObject method with the generated entity. I’m pretty sure that this sort of error will occur …

Continue reading ‘Unable to update the EntitySet ” because it has a DefiningQuery and no <> element exists in the <> element to support the current operation.’ »

reCAPTCHA with ASP.NET MVC 3 RAZOR using Microsoft.Web.Helpers and jQuery

My goal was to put a reCAPTCHA onto my registration page. I’m building the site using ASP.MVC using the Razor view engine. This is a holy hellish bitch to figure out how to get working the first time with all the conflicting posts from people on it and then of course some of it just …

Continue reading ‘reCAPTCHA with ASP.NET MVC 3 RAZOR using Microsoft.Web.Helpers and jQuery’ »

Updating Entity Framework EDMX when changes are made to the database.

This isn’t obvious, at least it wasn’t to me and for some reason when I searched for this I didn’t come up with the answer either. To update the Entity Framework EDMX and sync it with your DB changes you double click on the EDMX in the VS2010 Solution Explorer. This brings up the designer …

Continue reading ‘Updating Entity Framework EDMX when changes are made to the database.’ »

jQuery UI Slider and IE8 Compatibility Mode / IE7

After implementing the slider control from jQuery UI with our video player I was quite happy with the overall performance and the look and feel, unfortunately I experienced some headaches when it was deployed as the setup I had implemented did not work with IE8 in the compatibility mode. Now, thankfully the app was for …

Continue reading ‘jQuery UI Slider and IE8 Compatibility Mode / IE7’ »

Threading and ManualResetEvent vs Thread.Sleep

Found this really interesting post on StackOverflow that clarified the performance difference between using events and the more obvious but less efficient Thread.Sleep(). We have a real-time messaging app that we wanted to wait on calling back the client if a message was not queued up for delivery (to avoid unnecessary callbacks if messages were …

Continue reading ‘Threading and ManualResetEvent vs Thread.Sleep’ »

Javascript for in statement usage.

I don’t know why I forget the syntax for things like this. var cars = [“Ferrari”,”Subaru”,”Mazda”]; for ( var i in cars ) { alert( cars [i] ); } And since objects in Javascript are also associative arrays you can do things like this. var object = new Object; object.FirstName = “Harvey” object.LastName = “Meeker” …

Continue reading ‘Javascript for in statement usage.’ »

WordPress Google Syntax Highlighting with XHTML

Well, I set up this blog and then wanted a code syntax highlighter, because those are nifty. I installed this plugin and all seemed well. Then though I noticed the little XHTML link on the right side of the blog that is installed there by default and I clicked on it and it went over …

Continue reading ‘WordPress Google Syntax Highlighting with XHTML’ »

Winforms, DataGridViews and overriding events.

WinForms are archaic and outdated with the new hotness that is WPF (not really), but I still use them.  Not often enough to know much in detail about them, but enough to get myself into trouble. I made a small app with a data entry/update form and then on another tab added a DataGridView that …

Continue reading ‘Winforms, DataGridViews and overriding events.’ »