Sunday, February 1, 2015

How to create bootable USB drive for Windows 7 installation

You can now create bootable USB drive without using any third party software. To create please follow the below steps.

Insert Windows DVD or mount Windows 7 setup in case you have copied setup file in your PC.

Run CMD as administrator then begin type in the below codes:
1. diskpart
2. list disk
3. select disk (Number of USB drive) e.g.: 1 – The number varies depending on amount of drives in your PC
4. clean
5. create partition primary
6. select partition 1
7. active
8. format fs=ntfs quick (may take a couple minutes, depending on the USB drive size)
9. assign
10. exit
11. D: cd boot (Please check which letter is assigned to your DVD drive by opening ‘My Computer’. Label of DVD drive must be entered in Capital letter only.)
12. cd boot
13. bootsect.exe/nt60 e: (Please check which letter is assigned to your USB drive by opening
‘My Computer’. For e.g.: here ‘e’ is given)
14. exit

Now your USB is bootable then just copy windows 7 setup files to the USB and in boot manager set first priority as USB drive.

Thursday, November 28, 2013

[Solved] Can't change table design in SQL Server 2008


The Save (Not Permitted) dialog box warns you that saving changes is not permitted because the changes you have made require the listed tables to be dropped and re-created.

The following actions might require a table to be re-created:

Adding a new column to the middle of the table
Dropping a column
Changing column nullability
Changing the order of the columns
Changing the data type of a column


To change the Prevent saving changes that require the table re-creation option, follow these steps:


  1. Open SQL Server Management Studio (SSMS).
  2. On the Tools menu, click Options.
  3. In the navigation pane of the Options window, click Designers.
  4. Select or clear the Prevent saving changes that require the table re-creation check box, and then click OK.
  5. Note If you disable this option, you are not warned when you save the table that the changes that you made have changed the metadata structure of the table. In this case, data loss may occur when you save the table.


Risk of turning off the "Prevent saving changes that require table re-creation" option

Although turning off this option can help you avoid re-creating a table, it can also lead to changes being lost. For example, suppose that you enable the Change Tracking feature in SQL Server 2008 to track changes to the table. When you perform an operation that causes the table to be re-created, you receive the error message that is mentioned in the "Symptoms" section. However, if you turn off this option, the existing change tracking information is deleted when the table is re-created. Therefore, we recommend that you do not work around this problem by turning off the option.



Sunday, June 30, 2013

MVC4 with jquery-ui datepicker

Here's the steps, and they're very simple.  You only have to do it this way if you want to use the built-in bundling and minification, if not you can always use the exact same code you would use in an HTML page, but you would have to comment out the bundle generation code.


  • Create a new MVC4 project and Select the Internet template. Use all default options.
  • Edit the _Layout.cshtml in ~/Views/Shared and add these two lines after the jquery bundle at the bottom
  • @Scripts.Render("~/bundles/jqueryui")
  • @Styles.Render("~/Content/themes/base/css", "~/Content/css") -- NOTE Styles.Render, not Scripts.Render as in your code
  • Either edit the Index.cshtml and delete everything, or create a new Controller action and blank view.
  • Inside the view, add the following code, Press F5 and you're done!




Friday, June 21, 2013

Visual Studio 2010 Startup Gets Faster, Just disable TFS autoconnect feature and Save a lot of time

If you have experienced that opening Visual Studio 2010 takes too much time as it tries to connect to TFS automatically, you can now disable TFS auto connect and once visual studio is up then connect it to TFS which take very less time.

For achieving this You can install the TFS power tools, you can download it here


  1. Please close all the Visual Studio and TFS instances before you start installation.
  2. After installation open up a visual studio command prompt and run the command “tfpt connections” this will bring up a dialogue which will show all of your available TFS servers and Collections.
  3. There are 2 options you can try, firstly uncheck "Automatically connect to server on startup" this should stop VS trying to connect to TFS when you open a solution.
  4. If that doesn't work then click on the "+" next to the TFS server and select the collection you are using for source control. Hit the "Edit" button and you should see a checkbox called "Server is Offline" select this and you will no longer be connected to TFS.
  5. To reverse the behaviour use the same tool to togle the values back to their defaults.


Sunday, June 16, 2013

How to Allow Visual studio to let you edit the code while debugging? Allow Editing the code while debugging.


Many times we come across a situation when we are debugging the code in Microsoft Visual Studio and we find something is missing in our code and we need to change it.
If our setting is not proper we need to stop debugging and then change the code and re run, which takes a lot of effort and time.
To avoid this we can simply do the following :

If you want to make any changes while debugging then you can edit and continue the application, if that option is enabled. to check this option is enabled or not, go to Tools->Options then 



There you go :)

Friday, April 19, 2013

Run Visual Studio 2012 as administrator every time


As a developer I spend my life inside Visual Studio. Since I installed Windows 8, I was having trouble opening web projects. Turns out that I need to run Visual Studio as an administrator.

Rather than right clicking the shortcut every time and another click to run as administrator, I found a permanent solution. For the lazy me, it saves two extra clicks.

Open properties of the shortcut to Visual Studio 2012, go to Shortcut tab.


Click on Advanced and then check Run as administrator checkbox.


Yipppie !!!


Thursday, March 28, 2013

Adding custom fields to a VS2012 MVC4 SimpleMembership system

Adding custom fields to a VS2012 MVC4 SimpleMembership system
Add custom columns/fields to your MVC4 SimpleMembership "UserProfile" table
MVC 4 in Visual Studio 2012 introduces the new SimpleMembership Provider as its default web-based authentication system. While this system is much simpler than the earlier ASPNETDB system that it replaces, there definitely are a few new and neat tricks to be learnt.

One of them is: How do I add custom fields to my MVC 4 registration system?

It can be done in just 4 simple steps:

1. Start up VS 2012, and create a new MVC 4 web project. Set up your SimpleMembership registration system - for some help, please see post on setting up a SimpleMembership Provider in a VS2012 MVC4 project.

2. Next, run the project and navigate to the login page, so that the tables get created. It is not necessary to create a user at this point.

3. Then, in your database, alter the table UserProfile, and add a column: FullName (nvarchar(50)).

4. Next, add/reference the new FullName field in the following programs in your project:
In class UserProfile, in AccountModels.cs (to ensure the class matches the table columns):

    [Table("UserProfile")]
    public class UserProfile
    {
        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
        public int UserId { get; set; }
        public string UserName { get; set; }
        // Customization: Field(s) added
        public string FullName { get; set; }
    }

In class RegisterModel, in AccountModels.cs (to enable handling on the registration form):

    public class RegisterModel
    {
        // Existing code
        // ...

        // Customization: Field(s) added
        [Required]
        [Display(Name = "Your full name")]
        [DataType(DataType.Text)]
        public string FullName { get; set; }
    }

In the Register.cshtml view (so it'll appear on the user registration form), add a new li element with the following content:
    @Html.LabelFor(m => m.FullName)
    @Html.TextBoxFor(m => m.FullName)

In the [HttpPost] Register ActionResult, in AccountController.cs, modify the call to the CreateUserAndAccount method (to write the new column to your database):
    // Customization: Field(s) added when creating a new account
    WebSecurity.CreateUserAndAccount(
        model.UserName,
        model.Password,
        new { FullName = model.FullName }
        );

Now run your program and register a new user, supplying a value for the FullName field... success! The new row created in your database table contains the value supplied for the new column!

Note: This post covers how to create a custom column. A near-future post will explain how to access the value of that column from within your VS 2012 MVC 4 projects. Please re-visit my blog occasionally :)

Happy coding!