Gaining Some Control Back From Microsoft’s Entity Framework Code First, Name Your Own Foreign Keys!

Being a relative newbie to Microsoft’s Entity Framework Code First, there are things that I don’t like, things that I don’t understand, and well, just things that really bug me.  The problem is I often find out that the things that I don’t like and bug me are often lack of knowledge and not lack of product (at least not easily discoverable in the product).  One of those things is that Code First makes up names for foreign keys that don’t happen to be the same name as I would use.  Since there are times when you will need to look at these names (and possibly code with them (for another post)), I would like those names to be my names. Let’s say you have a simple relationship between two tables.  Let’s call it User and … Continue Reading

A Quick Tip On How To Ignore Time When Querying From SqlServer

Seems like this comes up a lot so I thought I’d blog about a clean way I found to do this from a StackOverflow article.  Basically, the problem is if you have a bunch of Sql records that have date and times in them (not 00:00:00 for time), using Microsoft’s SqlServer.  You may want to query all records that are on a certain date.  You can certainly for a query that looks like:   SELECT * FROM VolunteerJobs WHERE JobStartTime >='08-01-2008' AND JobStartTime<='08-14-2008 23:59:59.996' However, this feels a little awkward.  A better way that I plan on using is:   SELECT *FROM VolunteerJobWHERE DateAdd (day, datediff(day, 0, JobStartTime), 0) = '2010-10-09' Somehow, it … Continue Reading

With Visual Studio 2011, How To Add a Second Project To a Solution

  Say you have an existing Microsoft Windows Forms Application and you want to create a class library for it to reference.  For some reason, I’ve been stuck with this problem for a while now and I accidentally found the “unintuitive” button by accident of how to do this. My expectation was that when I created a new solution in Visual Studio 2010, that it would show 1 project in the solution and then to add more projects, I’d right mouse button on the solution and say “Add New Project”.  Sadly, the solution explorer does not show me my solution, just the one project I have in it, regardless of whether I opened it directly (for which I think it creates it’s own solution) or I opened from my newly minted solution file. That … Continue Reading

Accidentally (or on purpose) Making A ClickOnce Application your default IE9 Page

So, I’m testing a Microsoft ClickOnce application in a virtual machine and for convenience, I set the default page to be my ClickOnce page of the application I was testing.  Clearly, I was not of full clarity because what happens now is when I run IE, it checks to see if the application is up to date, then immediately exits IE.  Problem is, I can’t actually stay in IE long enough to change the default to anything else, and of course, I can’t run IE anymore. So, following what Daniel Boom once said (he was never lost, just at times confused as to where he was for a couple weeks), I began wondering how I could get my IE back without resorting to registry tweaks. The solution was to simply find an application that had a help window … Continue Reading


Get every new post delivered to your Inbox

Join other followers: