Sunday, May 27, 2007

Bluetooth Settings for PocketPC Devices


For Widcomm bluetooth stack based devices settings are

For BT InboundPort : [HKEY_LOCAL_MACHINE\SOFTWARE\Widcomm\BtConfig\Services\0001]
For BT OutboundPort : [HKEY_LOCAL_MACHINE\SOFTWARE\Widcomm\BtConfig\Applications\0001]
For Bluetooth Mode Status : [HKEY_LOCAL_MACHINE\SOFTWARE\Widcomm\BtConfig\General\StackMode]



For Microsoft bluetooth stack based devices settings are

For BT InboundPort : [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Bluetooth\Services\0001]
For BT OutboundPort :
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Bluetooth\Applications\0001]
For Bluetooth Mode Status :
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Bluetooth\General\StackMode]

Friday, May 18, 2007

My Solution for "An error has occurred on the computer running IIS. Try restarting the IIS server" Error

I got this error while I was working on SQL Server mobile and Merge Replication. The solution was working fine initially but later on I switched my emulator from WM 5 to WM 6 & I got this error. I tried the same solution back on WM 5 , but it gave me same error, I tried to solved it by providing network credentials but it didn't solved my problem. So used my (or I'll say everyone's ) most effective weapon to solve ambiguous errors i.e. System reset :). I restart my machine & the solution start working fine. Magic!!!
I donno reason behind this, but it served my purpose.

Monday, May 14, 2007

Determine if a table exist in SQL Mobile database.

If you wants to find out that whether a particular table exist in a SQL Mobile database, here is a simple solution.
Fire the following query from COmmand.ExecuteScalar.
SELECT count(*) FROM INFORMATION_SCHEMA.TABLES where TABLE_NAME = @TableName

If it returns 1; it means the table exists in the database & if it returns 0 then it means the table doesn't exists.

Wednesday, May 2, 2007

The Easiest and quickest way to create a ConnectionString

Creating a connection string is always a complicated task - providing credentials, rights & all. But few years ago one of my colleagues told me a quick way to create a connection string & I guess it is the easiest way.
The steps are
1. Create a new file by right clicking on desktop; from context menu select New then select Text File (you can select any file).
2. Rename the extension of this file to "UDL"; in this case it would be from "txt" to "udl".
3. Neglect the rename message and save the file. You can see a new icon.
4. Open this file by double clicking on the icon; you can see the Providers, connection tab. So specify your server, Provider and database name and click "Ok".
5. Now Open this file in text box and you can see the connection string for the database you have selected.

Tuesday, April 3, 2007

Mobile Client Software Factory

From last few weeks I was in search of a module for .NETCF that can work with Web services in connected and disconnected mode, first I came across OpenNETCF application block, but as I mentioned in my previous blog Smart Client offline application block (SCOAB) I faced a lot of problems just to compile that and same problem continued while creating a POC using SCOAB, Later I found out Mobile client software factory a project from the Microsoft patterns & practices team @ Codeplex. I found that this Software factory provides various features for applications based on .NETCF 2.0. It includes
  • The Mobile Composite UI Application Block and ObjectBuilder
  • The Configuration Application Block
  • The Connection Monitor Application Block
  • The Data Access Application Block
  • The Data Subscription Application Block
  • The Disconnected Service Agent Application Block
  • The Endpoint Catalog Application Block
  • The Orientation Aware Control Application Block
  • The Password Authentication Application Block
Disconnected Service Agent Application Block is serving the feature that I was searching from last few weeks. It works with Configuration Application Block, Connection Monitor Application Block,Data Access Application Block, Data Subscription Application Block and Endpoint Catalog Application Block to work in connected and disconnected mode.
So overall logic behind is that when the connection is available the requests are send th Web service & when it is not available i.e. in disconnected mode the requests are stored in SQLCE database on the device & when the connection is available the requests dispatched to Web service. The overall architecture and design of these application blocks is awesome. User can easily create any mobile application using theses AB's. The most important feature I would like to mention here is the documentation provided with this Software Factory is complete & explains the technical details and Howto's in best possible way.

Looking forward to use the rest of the application blocks from Mobile Client Software Factory