Thursday, 27 November 2014

Attach database failed for Server. (Microsoft.SqlServer.Smo) An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo) Unable to open the physical file . Operating system error 5: "5(Access is denied.)". (Microsoft SQL Server, Error: 5120)

Connect to the server using an administrator account with access to the file system for the database files and through Windows Authentication rather than using sa through SQL Server Authentication.

Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

This command just surprisingly solved it:

%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i

This repeats IIS registration\installation although I had no problem while installing it as Windows Feature.

Wednesday, 26 November 2014

Taking a SQL server database offline fails or killing a database connection

In most cases, when the operation for taking a database offline; this is attributed to connections established to this database. The apparent solution is to close the locking connections, the below is how to force them closed.

Use [master]


spid | ecid | status   | loginame | hostname | blk      | dbname | cmd 
58    | 0     | sleeping| user1        | user1PC   | NULL| MyDB   |LOG WRITER      


Command(s) completed successfully.

- sp_who2 provides even more details about the current connections.
- No need to mention that you must have the appropriate rights on the master database to perform this commands.

Monday, 24 November 2014

Holidays calendar in an easy to import to Outlook calendar format

1.Create a new file "2015_Holidays.hol"

2. Add the required holidays text in the file in the following format:

[My 2015 Holidays] 4
New Year's day,2015/01/01
Coptic Christmas,2015/01/07
Holiday #4,2015/10/20

3. Open the file where Outlook is installed to import the holidays directly to your profile calendar.

* Good reference about that same topic:
Add or delete holidays and custom events in your calendar:

Thursday, 6 November 2014

Moving iPad Keyboard - docking\undocking

The trick is that you have to keep tapping the keyboard button until the menu appears:




Wednesday, 5 November 2014

MS Excel: Enclose text in double quotes

Assuming that the target column with the text values is A:

1) Create a new column with the following expression: = """" &A1 & """" at the first cell. Drag\Double click to fill the whole column.

2) Copy the values from this new column, and paste them Paste Special --> Values into a third column. Drag\Double click to fill the whole column.

3) You can now delete the original column A and replace it with the column in step (2)

Migrating contacts from HTC Cha Cha Android phone to iPhone

1) Export contacts from the device into the SD card memory in vcf file format. Unfortunately, this would be extracted into a single vcf file, so MS Outlook is unable to import directly.

2) Convert this single file into a vcf file per contact:
   a) Import the file into Windows Contacts: %userprofile%

   b) Export the contacts into vcf

3) Drag and Drop all the vcf files into the Contacts\People folder for MS Outlook 2013.

4) Export all the contacts from MS Outlook into csv file which is a very versatile format and widely supported.

5) Import the just exported file into any mail service, in my case, I have used my gmail account at

6) Configure iPhone to contacts to synchronize with the gmail account.

7) Done! All your contacts are now within your iPhone phone application\service contacts.

HTC Cha Cha - Android OS
Windows 8.1
MS Office 2013
iPhone iOS 8.1

Thursday, 16 October 2014

Changing Chrome Internet connectivity settings on Windows: Internet Options

Fortunately, it is using the Operating System Internet Options dialog which typically can be easily displayed from Internet Explorer.

Internet Explorer* --> Tools --> Internet Options

* Internet Explorer 11.0.9600
Windows 7 Professional SP1 64-bit

Wednesday, 24 September 2014

Three reasons can render you idle in your busiest days!

There are always some periods through our workdays when we are so overwhelmed to the extent that we are literally paralyzed. This is the situation when we are unable to progress in any of the areas where we should be exerting more effort.

Stress can be one of the biggest factors that disseminates the negative energy within our whole beings. So many projects, inefficient communication and un-prioritized task lists are among the very common sources

Shortage of resources such as having a shortage in funding for your projects or the man power for implementing the actual work can be the second reason. When there are so many opportunities; however, for each one, there is always that small piece which is missing. Moreover, this can take the other form when you are so busy doing operational work to the extend that you cannot plan any reasonable schedule for a very promising project staying out there in your queue.

So little resilience in making your choices is apparently another good reason. This is to a great extent coupled with a micro manager who dictates not only the task but also the method to do the task, and expecting that the outcome would be at least coinciding with what she expects. This scenario can result in being unable to proceed or deliver due to the least missing details within the implementation strategy previously communicated. The focus here is on following the steps rather than delivering the outcome and the outcome is assumed to be a guaranteed fruit for the steps performed.

Monday, 8 September 2014

Server Error 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.

I problem which might have kept me overnight in the office!!!

Microsoft IIS 7.5
Windows Server 2008 R2

Trying to share the root web folder.


Server Error
500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.

- Removing the share.
- Deleting the Temporary ASP.NET files
- Restating the  IIS

1 - Creating a new web root folder and moving all  the application folders to this new folder.
2 - Configuring all the application folders to point to the new folder.