SQL Server Data Tools – September 2013 Update.

New update for SQL Server Data Tools.


You can do one of the following:

  1. For Download and Install go to: http://go.microsoft.com/fwlink/?LinkID=320745
  2. For Administrative Install Point, when you are going to install from a place without internet connection: http://go.microsoft.com/fwlink/?LinkID=320745&clcid=0x409

Then run the following command with administrative privileges (CMD run as administrator)

SSDTSetup.exe /layout <destination>

After the install point is created, run SSDTSetup.exe from <destination> with no arguments.

Posted in SQL Server | Tagged , , | Leave a comment

Failover or Restart Results in Reseed of Identity

Bug with Id: 739013, opened: 4/26/2012

When a table with less than 1000 rows that has an identity value is part of a database that is failed over in an AlwaysOn availability group, the identity is reseeded to 1000. If the identity value is already over 1000 no reseed occurs. This also occurs if you restart the server.

This is happening in Azure databases too.

Example: In a table “X” your Id starts in 1, 2, 3, 4 then suddenly 1005, 1006, etc. And you don’t know when it will happen.


Some people think this has something to do with Sequences like this:


One workaround is using the startup flag T272 but how to specify this in Azure?

Also some people say this keeps happening even when you get over 1000 rows.

Posted in Azure | Tagged , , , | Leave a comment

14 Rules for faster-loading Web Sites.

These 14 rules came from Steve Souders’ book High Performance Web Sites (O’Reilly Media 2007).

Rule 1 – Make Fewer HTTP Requests
Rule 2 – Use a Content Delivery Network (CDN)
Rule 3 – Add an Expires Header
Rule 4 – Compress Components with Gzip
Rule 5 – Put Stylesheets (CSS) at the Top
Rule 6 – Put Scripts (JavaScript) at the Bottom
Rule 7 – Avoid CSS Expressions
Rule 8 – Make JavaScript and CSS External
Rule 9 – Reduce DNS Lookups
Rule 10 – Minify JavaScript
Rule 11 – Avoid Redirects
Rule 12 – Remove Duplicate Scripts
Rule 13 – Configure ETags (turn off)
Rule 14 – Make AJAX Cacheable and small

The Performance Golden Rule states that developers should “optimize front-end performance first, because that’s where 80% or more of the end-user response time is spent”

Posted in Web Development | Tagged , , , | 1 Comment

SQL Server Data Tools Update August 2013

There is a new update for SQL Server Data Tools (SSDT):
SQL Server Data Tools Update

The button Update takes you to: http://msdn.microsoft.com/en-us/jj650015

There you can Download and Install (you need internet access)http://go.microsoft.com/fwlink/?LinkID=320745

Or you can set up an Administrative Install Point (optional), once downloaded use:

SSDTSetup.exe /layout <destination>

Where <destination> is the location you wish to create the administrative install point, 1.8GB space required. Well in my case it downloaded 406MB.
To install use the install point and run SSDTSetup.exe from the <destination> location with no arguments.

Or you can download an ISO (optional)

Choose your venom.

Microsoft SQL Server Data Tools provides an integrated environment for database developers to carry out all their database design work for any SQL Server platform (both on and off premise) within Visual Studio. Database developers can use the SQL Server Object Explorer in VS to easily create or edit database objects and data, or execute queries.

Posted in SQL Server | Tagged , | Leave a comment

eBook offers.



Apress is offering a 50% discount on all eBook purchases through Sept 2nd.

They have a good selection of books maybe the one you need is there and 50% off…!!!


O’Reilly is offering 50% on *all* ebooks & videos. Spend more, save more – save 60% on orders greater than $100! Use discount code B2S3, this deal expires September 10, 2013 at 5:00am PT and cannot be combined with other offers. Offer does not apply to Print, or Print & Ebook bundle pricing.

It looks like a good offer too. Maybe the book you need is from O’Reilly!!!

Posted in eBooks | Tagged | 1 Comment

How to use Metro UI CSS in ASP.NET MVC 4 ?

Metro UI CSS allows to create a Web site in the style of Windows 8 quickly and without distractions on routine tasks. You can find more info here: http://metroui.org.ua/

UPDATE. This article is about version 0.95 now Metro UI CSS is in version 2.0 and the following is no longer accurate so you better read this other post https://pepitosolis.wordpress.com/2013/12/29/using-metro-ui-css-version-2-0-with-asp-net-mvc/

To use Metro UI CSS in your ASP.NET MVC 4 project do the following:

Download the Metro UI CSS file “Metro-UI-CSS-master.zip” from https://github.com/olton/Metro-UI-CSS you need to copy some files from this zip to your project.

Copy the following files:

1. In Visual Studio in your “Content” folder copy these 2 files: modern.css and modern-responsive.css, the file theme-dark.css is only necessary if you are intending to use it.

2. Depending on what project template you used you may or may not have the folder “Images”, if you don’t have the folder create it. You should copy these files if you are intending to use them. So copy to your “Images” folder the files in the zip inside “images”:

  • preloader-w8-cycle-black.gif
  • preloader-w8-cycle-white.gif
  • preloader-w8-line-black.gif
  • preloader-w8-line-white.gif

3. In your “Scripts” folder copy the files in the zip inside the folder “javascript”, once again you should copy the files that you are going to use. The files are:

  • accordion.js
  • buttonset.js
  • calendar.js
  • carousel.js
  • contextmenu.js
  • dialog.js
  • dropdown.js
  • input-control.js
  • pagecontrol.js
  • pagelist.js
  • rating.js
  • slider.js
  • start-menu.js
  • tile-drag.js
  • tile-slider.js

4. Create a folder called “less” and copy the files in the zip inside the folder “less”. Copy them if you are going to use “less” in your web server.

5. Create a folder called “fonts” and from the zip file copy the files in the folder “fonts”:

  • iconFont.eot
  • iconFont.svg
  • iconFont.ttf
  • iconFont.woff

Open file “modern.css” and “find and replace”


replace with


This is necessary to load the icons correctly. For instance: when using checkboxes because the “check” image is inside the iconFont.* file.

There are 4 different font files:

  • iconFont.eot
  • iconFont.svg
  • iconFont.ttf
  • iconFont.woff

In Visual Studio open the file App_Start/BundleConfig.cs and add the following lines:

bundles.Add(new ScriptBundle("~/bundles/metro").Include(
bundles.Add(new StyleBundle("~/Content/css").Include(

Put bundles.Add(new ScriptBundle(“~/bundles/metro”)… after the jQuery bundles. And the StyleBundle in the same location as the previous StyleBundle, comment or delete the previous StyleBundle.

Complete BundleConfig.cs listing:

using System.Web;
using System.Web.Optimization;

namespace MvcApplication3
    public class BundleConfig
        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles)
            bundles.Add(new ScriptBundle("~/bundles/jquery").Include(

            bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(

            bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(

            bundles.Add(new ScriptBundle("~/bundles/metro").Include(

            // Use the development version of Modernizr to develop with and learn from. Then, when you're
            // ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
            bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(

            bundles.Add(new StyleBundle("~/Content/css").Include(

            //bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css"));

            bundles.Add(new StyleBundle("~/Content/themes/base/css").Include(

UPDATE: As cmmaung commented when you add in the bundle “start-menu.js”


You will get an error in the file “start-menu.js” line 128 $(“body”).mousewheel… This error happens in Internet Explorer (tested in version 10 and 11) but works OK in Chrome and Firefox. I commented that line and runs fine but I didn’t correct the error yet. You can look in the following link for more information: http://www.sitepoint.com/html5-javascript-mouse-wheel/

Finally in Visual Studio open the file Views/Shared/_Layout.cshtml and

<!DOCTYPE html>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width" />
<body class="metrouicss">
    @RenderSection("scripts", required: false)

The metro container class “metrouicss” in body class is required to start using Metro UI CSS.

Example in a view called Index.cshtml


<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>

<span class="label">Default</span>

<table class="hovered">
      <th>Header 1</th>
      <th>Header 2</th>
      <td>row 1, cell 1</td>
      <td>row 1, cell 2</td>
      <td>row 2, cell 1</td>
      <td>row 2, cell 2</td>

<label class="input-control checkbox">
    <input type="checkbox" />
    <span class="helper">Checkbox Caption</span>

   <label class="input-control radio">
        <input type="radio" />
        <span class="helper">CheckBox Caption</span>

    <label class="input-control switch">
        <input type="checkbox" />
        <span class="helper">CheckBox Caption</span>
<div class="input-control select">
      <option>Option 1</option>
      <option>Option 2</option>

    <button class="default">Button2</button>
    <button disabled="disabled">Button3</button>
    <a class="button">Button4</a>

<div class="image-collection">
       <img alt="" src="~/Content/themes/base/images/2.jpg" />
       <div class="overlay">Sample text</div>

    <div class="rating" data-role="rating">

There is a NuGet package but it still requires some of the above changes. The package is called RTL Metro UI CSS 0.95-a.

To install, run the following command in the Package Manager Console

PM> Install-Package RTL-Metro-UI-CSS -Pre

It’s free but don’t forget to placed back link to Metro UI CSS site.

Style with <a href="http://metroui.org.ua">Metro UI CSS</a>

Posted in MVC, Visual Studio 2012 | Tagged , , , , | 8 Comments

Optimize Images with Image Optimizer.

Image Optimizer is a free extension for Visual Studio 2012 created by Mads Kristensen. It uses SmushIt and Punypng for optimization. You can get it from Extensions and Updates, search for “Image Optimizer”:


You need to restart Visual Studio and when you right click an image in the Project Window you will see this new options:


Optimize Image and Extract data URI to clipboard. You can see the results in the Output Window.

Posted in Visual Studio 2012 | Tagged , , , | Leave a comment