Sunday, 30 November 2014

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]
GO

sp_WHO 
GO

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


KILL 58
GO

Command(s) completed successfully.





P.S. 
- 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
Easter,2015/04/12
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:
http://office.microsoft.com/en-001/outlook-help/add-or-delete-holidays-and-custom-events-in-your-calendar-HP001230406.aspx


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:

Undock:

Undocked:

 Dock:




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 http://www.gmail.com

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