Thursday, May 14, 2009

Enabling CLR integration in SQL Server 2005

If you are working with SQL server CLR objects there’s a higher possibility that you might encounter the following error.

“Msg 6263, Level 16, State 1, Line 1
Execution of user code in the .NET Framework is disabled. Enable "clr enabled" configuration option”

To overcome this, you have to reconfigure the SQL server to enable CLR objects. To do that, you can use the following commands.

exec sp_configure 'clr_enable','1'

RECONFIGURE

Note : CLR objects only works with SQL server 2005 and later versions.

CLR Objects Tutorial

Wednesday, May 6, 2009

Using HP Bluetooth Devices with Microsoft Bluetooth Stack

I usually prefer to use the Microsoft Bluetooth stack (included with Windows XP SP2) instead of the WIDCOMM stack because it requires less recourse, is faster and also easier to use. The only thing missing is support for any Audio profile.

However, if you have a lot of HP notebooks or tablets, you normally can't use the Microsoft stack since it doesn't know the build-in "HP integrated module with Bluetooth wireless technology". But there is a way to do it anyway…

First, remove the WIDCOMM stack using Control Panel -> Add/Remove Programs. Next, restart you computer and open up "Device Manager" (execute Devmgmt.msc). The above noted device will appear as "Unknown device".

Next, open C:\WINDOWS\inf and open the file "BTH.inf" with Notepad. It will start with something like this:

Code:
; Microsoft Windows Bluetooth Driver INF ; Copyright (c) 2002 Microsoft Corporation
Scroll down until you find the following lines:
Code:
[HP.NT.5.1] "HP USB BT Transceiver [1.2]" = BthUsb, USB\Vid_03F0&Pid_0C24
Duplicate the last line and append it to the same section. Then change the PID as described below. The section should now look like this:

Code:
[HP.NT.5.1] "HP USB BT Transceiver [1.2]"= BthUsb, USB\Vid_03F0&Pid_0C24
"HP USB BT Transceiver [Patched]" = BthUsb, USB\Vid_03F0&Pid_011D
Note that we only have changed the last characters to the PID (Product ID) of the Bluetooth device. If you have a new laptop the PID might have changed. You can get this PID by double-clicking the device and using the details tab.

Save the BTH.INF, go back to Device Manager and select "Scan for Hardware changes". The device should now start to install. It might happen that the device is after reported as having a problem. If this happens, simple right-click it, select "Disable" and after that "Enable" again.

That should do the trick and you can use the Microsoft stack with the "HP integrated module with Bluetooth wireless technology".

Enjoy!