Posted by Jamie Munro | April 30, 2012 | Tags: dbcontext, entityframework, mvc3, objectcontext
If the following blog interests you, it’s probably because you’re using Entity Framework with a Code-First approach and whatever it is you are trying to do *must* use an ObjectContext instead of the standard DbContext. I’m sure, like me, you thought this shouldn’t be too hard. Then you started hitting roadblocks like, Metadata is required in your connection string. What’s metadata? This is only needed in Database-First so you can tell the framework where your edmx and other definition files are, so why do I need this with Code-First, I don’t have these files?
This was definitely my first reaction as well. So after much trial-and-error and research, I have the solution!
Posted by Jamie Munro | March 19, 2012 | Tags: css3
The hr tag has been around for quite some time to provide a nice horizontal line to visually separate content. To achieve a vertical line, it’s typically been accomplished via border-left or border-right. However, this is when you can get into height issues or columns that don’t extend the whole way, etc… Instead CSS3 allows for the rotation of elements and allow for vertical or diagonal lines to be created with some basic CSS.
No more must you think about how to find a clean way to delete duplicate records in your database table. The following article will provide a single SQL query that will delete rows that are duplicated in your table. Before you begin, be sure you’ve tracked down the bad code that is causing this; otherwise, you will need to run it multiple times!
Posted by Jamie Munro | March 5, 2012 | Tags: css3
As more and more browsers support HTML5 and more importantly CSS3, it begins to allow us much more freedom using standard text without the need of images. Not only does this speed up page load times, it also lowers bandwidth costs as well. Using CSS3, many standard DOM (Document Object Model) objects can easily be rotated, such as: images, text, block elements, etc…
Posted by Jamie Munro | February 27, 2012 | Tags: MySQL
This is an excellent little trick that will save some processing time by a server-side language having to loop through the data to achieve the same result. In this article, I am going to demonstrate how you can merge multiple rows into one field separated by a specific character.
Posted by Jamie Munro | February 20, 2012 | Tags: css3
Do you have a nice background image that you don’t want hidden by a solid color and your content? With some CSS3, a background color can be set with an opacity value so that the content or image beneath will be visible through it.
Posted by Jamie Munro | February 13, 2012 |
Probably not required often, but you just never know when you might need to set the cursor position inside a textarea tag that you have on your website. Perhaps you want to add a button that will insert some text before the current cursor position and set the cursor back to where the user left it afterwards. In the following example, I will create some basic functions to allow you to set where the cursor goes inside of a textarea.
Posted by Jamie Munro | February 6, 2012 | Tags: mvc3
Have you ever wanted to pass form data or perhaps even a full model from one action to another through a RedirectToAction? By adding a new library package from NuGet, this can be accomplished with a few small changes to your controllers.
Posted by Jamie Munro | January 30, 2012 | Tags: jquery
Every so often you will receive data from a database or potentially user input, but a specific number of characters might be required to format or display the data properly. As an example, you may wish to ensure that a number less than 9 is prefixed with a 0 where numbers that are 10 or more do not need the padding. By extending jQuery, two functions can be created to either prefix or postfix a specific value to a DOM element using a jQuery selector.
Posted by Jamie Munro | January 23, 2012 | Tags: css3
Do you see the gradient blue above for the title of this article? If you don’t then your browser doesn’t support CSS3 gradients. However, if you do see it, you’ll be happy to know that I saved you and me some bandwidth by not using an image! Instead, some CSS3 is used. So next time a designer provides you a PSD with a bunch of gradient images forget “chopping” them out and use the following example instead.