Wednesday, February 23, 2011

Prevent Saving Changes to table in SQL Server

If you are facing a problem while saving any changes to a table in SQL Server with the error message
"Saving changes is not permitted. The changes you have made require the table to be dropped and re-created". It is not a problem in Sql Server 2005 Management Studio or Sql Server 2008 Management Studio but you need a little help in changing a few options.


Solution:
The solution is very simple. Follow the steps below:
Step 1: Click on Tools menu in SQL Server Management Studio
Step 2: Click Options
Step 3: When the option menu is displayed explore Designers on the left side of the window.
Step 4: Uncheck "Prevent saving changes that require table re-creation.
Step 5: Click OK 



Thursday, February 17, 2011

How to Convert docx file to doc

.docx is the file extension of MS-Word document created in MS-Office 2007 or above. You can open these files only in newer versions of MS-Office (eg; 2007 and 2010). To open these documents in previous versions of MS-Office you need to convert them first.

Method 1:
In this method you must have MS-Office 2007 installed with you on you computer.
Step 1: Go to File Menu
Step 2: Click on Save As
Step 3: Select "Word 97-2003 Document" and select the location where you want to save the document with appropriate name.

Method 2:
You can use some third party software to convert .docx file to .doc file. You can download such files free of cost. One of the example is http://docx-converter.com/widget/
The problem in such types of software is that they remove some of the formatting. But again this varies with the software which you have been using for converting the file.

Note: .docx is XML based and is compatible with other operating systems too, like linux based operating system and Max OS x.



Sunday, February 13, 2011

IFrame Busting / Anti-Framing

IFrame:
An <iframe> tag of HTML allows you to add a website as an object to a particular region in you website. You can open a link inside you page at any place. So you webpage will be a container of that target webpage.

For Example: I can open http://www.google.com/ inside my blog in a particulart region as below:


Code:
To do this you just need to add a line of code
<iframe src="http://www.google.com" width="400px" height="200px">

IFrame Busting:
But there are cases you don't want your website to be contained in some other website. And you can stop it to be placed inside some other website. To do that you need to use a technique called Iframe Busting or Anti-Framing.
For example:
If you add the HTML code below to you webpage it will redirec you to windows live home page.
<iframe src="http://www.hotmail.com" width="400px" height="200px">
The reason is that hotmail does like it to be contained inside some other webpage.

To achieve this in your webpage you don't need to do a lot. Just copy and paste the line below to you javascript code in the <head> and that's it.

if (top != self) { top.location.replace(self.location.href); }

That's the whole miracle.

In the post about IFrame we will come up with a technique called "IFrame Busting Buster". In-case you want to force a page to be used in your webpage inside an iframe.