Jacky's Microsoft C# Thinking

Microsoft.MVP MSMVPs = Microsoft.MVP("Jacky Yiu");
MSMVPs.Blog.CSharp.Knowledge.Sharing.SetExpectation("Enjoy");

i-mate JASJAR review
I’ve got an i-mate JASJAR on yesterday from Microsoft for PPC Phone review, I should say thank you to Microsoft first. Thanks a lot!!! i-mate is the first company to launch the Windows Mobile 5 device in the market, and the configuration of JASJAR is the top and high-end model in between PPC Phone. After extract the packet, you will found the following accessories are in the package: 1 x i-mate JASJAR 1 x i-mate JASJAR Battery (1620 mAh) 1 x i-mate JASJAR Standard Protection Case 1 x i-mate JASJAR AC Adapter (UK) 1 x USB Cable 1 x Hand Free 2 x Pens 1 x User Manual 1 x Quick Start Manual 1 x CD-ROM Extra accessories: 1 x AC Adapter (US) When I start the PPC and finish the standard system configuration, I found there has already installed some enhanced software, such as: smart dialer, anti-virus, skype and one i-mate game (Backgammon), Download Agent, MIDlet Manager, Terminal Service Client. These are very useful for a beginner user, they do not have to download and install these software. As a beginner, most of them are offer resistance to install software. I would like to use the PPC once I open the device, and without additional installation for enhancement. Compare other same grade (mini-notebook and executive) PPC Phone in the market, JASJAR already installed a high-end hardware configuration and software copulation. It is a good for me to use my first PPC Phone. At least, smart dialer anti-virus and skype is the basic feature in nowadays PPC Phone, but I know there has some band will not include these software in start-up and they have to download and install these software. I was looking for the ROM version after check the installed software. JASJAR is not yet update the ROM for the user, and user have to login to the clubimate.com and download the new version and installed by themselves, even that is only a few step, but I think it is a bad experience for the new user to buy the phone since the newer version is launch at Feb 2006 but the PPC is still installed the oldest version. As I know in other band, they will update the ROM version once a newer is launch. For the preinstalled application, I did not test too much in details, only voice speed dial, smart dialer, and anti-virus. Voice Speed Dial is required you provide a training to the speed dial of each contact in your contact list or any application in the device. That means you have to read the name of each contact or application name and record it in the device. In personally, it’s a quite outdated feature in nowadays, since in the band which starts with “D” has included a voice command program. You only can speak the command and the name in your contact list, it will help you to run the application or dial to the contact, on beside, you only have to train the device about your voice speed and frequency, and it will automatically to search in your contact list without record the name each by each. I believe it is much better than record each people in your contact list. Smart Dialer is a really cool application for PPC Phone or Smartphone. Just a few steps you can search or filter the number which you want to dial like when I want to call “Peter” and his number is 91827364, I can enter either “73837” or “91827364” to filter “Peter” or “91827364”, and of cause, when you enter 3-4 keys, you can be select the contact in the filtered list. And JASJAR is the first 3G PPC Phone in market, in the dial page, your can select to call the contact in voice call or video call. JASJAR is already installed a Anti-Virus installer, you can go to “Program” and found the anti-virus, run it and it will install the anti-virus, after installed the anti-virus it will required to update the virus data online, so you should connect to the internet throw GPRS, wi-fi or throw ActiveSync to connect to the internet and get the newer virus database. When I start the program, a simple interface is clean to understand what should do and the scan review is quite details. But I don’t know is that a good anti-virus, as I did not install any virus in my JASJAR, but it is very cool feature for a new device. After the use and test all installed software and now I am going to check the hardware. In JASJAR, the following is the keyboard, button and switch configuration. 62 Keys QWERTY Keyboard 1 x Power Button 1 x Backlight Button 1 x Camera Button 1 x Voice Speed Dial Button 1 x Volume Control 2 x Phone Button First I can confirm the power, voice speed dial, camera button and volume control is working, but when I try to backlight button, nothing is effected, I did check the user guide, online support, but the backlight button still now working, but when I long press the power button, it will turn off and on the backlight, but I cannot turn off the device. I just wonder why there has a backlight button but the backlight setting is not set in a right track, and HOW TO TURN OFF THE DEVICE??? After test the accessory button, I want to test the phone quality. When I dial a call, no voice is output in the earphone, and when I switch to speaker mode and hand free mode everything is work fine. But the strange is microphone is worked fine in every mode, just the earphone is not working. Then I have tried to post the question in their online support forum, but still now, no one answer my thread. I do not know it is a special question so there has no one can answer me, or their online support is not that effective. Except the ROM, earphone and their supporting, I trust JASJAR is a good PPC Phone on the market, if you want to buy a JASJAR, please download the updated ROM at once, and check the earphone clearly. Moreover is Enjoy your JASJAR. Cheers
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done

I've received an email from a friend on yesterday. the content is below! just to share.

Hello,
     I am facing a problem regarding .NET deployment issue. My team developed an application on C# on Windows XP and that application runs perfectly on all Machines running Windows XP but this application generates an unhandled Exception "Multiple-step OLE DB operation generated errors.
Check each OLE DB status value, if available. No work was done."

This Exception is thrown in condition...

(i) When I run my applicatio on the Machine running Windows 2000.
(ii) When I set the compatibility of application to "Windows2000 " on Windows XP Operating System.

Code
----
Conn = new OleDbConnection();
Conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\MAP1.4.mdb;";
Conn.Open();   <----    Exception Thrown at this Statement

If anyone of u have any idea about handling this so plz reply me.

Regards
Adeel
------------------------------------------------------------------------------------------------------------------------------------

There has 2 possible causes to fire this exception:
1) There should have an entry “OLDDB_SERVICES“ in CLSID in registery when using ADO connection.
2) Error occur in your connection string

Reference for case 1
http://support.microsoft.com/kb/269495/EN-US/

Reference for case 2
http://www.connectionstrings.com

How to Move Shell Folders (and contents)

I've found an article which is wrotten by Kent W. he is a MVP from England. The article is about how to move shell folders, I think it's quite useful when MCE(Microsoft Windows XP Media Center Edition) launch. Enjoy it~

Shell folders are special folders that Windows uses to indicate the default location for many types of settings and data. These shell folders may be moved in a bewildering variety of ways: by a right-click Move Here in Windows Explorer, by a registry key edit, or by using TweakUI for XP.

Be certain that no documents are open before you start a move process, otherwise the move will be incomplete and your old folder will not be deleted. You will have to close open processes and then manually move any files that were not moved in the move operation. Best to do this right after a logon.

One way to move My Documents is to right-click the My Documents folder under Desktop in Windows Explorer and select Properties. Move the folder with the Move button. This is the only shell folder that can be moved from its properties tab. Be careful to enter the path to the new "My Documents" folder, not to its parent. In other words, if you want the new "My Documents" folder to be D:\My Documents, then you must enter that string in the Target box.

To change most shell folder locations immediately and move the contents, right-click the shell folder in Windows Explorer, drag the folder to the new location, release the mouse button, and select the Move Here item. If Windows Explorer complains, then you must use the registry to move the folder location and manually move the contents.

The default user shell folders location is in %USERPROFILE% which is "C:\Documents and Settings\user".

Administrative Tools system utilities folder (Shell Folders)
Application Data location for applications to store user settings
CD Burning location for temporary storage of files for ISO burn
Cookies IE cookie folder
Desktop desktop shortcuts
Document Templates default location for application new document templates
Favorites IE URL links
My Documents Application default document folder
\My Music default music file folder
\My Pictures default graphic file folder
\My Videos default movie file folder (Shell Folders)
SendTo right-click context menu item
Start Menu user All Programs menu
\Programs user All Programs shortcuts
\Startup user logon startup folder

The shell folder locations are in the Registry at HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders and/or in \Shell Folders. Edit the key in User Shell Folders if present. If not, edit the key in Shell Folders. There is no need to edit both keys if both keys are present.

Changing these keys will change the shell folder location but will not move contents. The Administrative Tools and My Video shell folders are located at HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders and are not present in User Shell Folders.

Recent (My Recent Documents) cannot be moved in Windows Explorer, but must be moved in the registry. It is best to leave the Local Settings shell folders alone or change the location in the registry at User Shell Folders. The Temporary Internet Files can be moved in the Internet Options control panel.

The following shared shell folders are located in the All Users profile and are in the Registry at HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders or \Shell Folders. These shell folders are available to any user, but are not network shared. The path is %ALLUSERSPROFILE% and is "C:\Documents and Settings\All Users" by default. Some of these common folders may be moved in Windows Explorer.

Common Admin Tools (Shell Folders)
Common AppData
Common Desktop
Common Documents cannot be moved in Windows Explorer
\Shared Music cannot be moved in Windows Explorer (Shell Folders)
\Shared Pictures cannot be moved in Windows Explorer (Shell Folders)
\Shared Video cannot be moved in Windows Explorer (Shell Folders)
Common Favorites
Common Programs
Common Start Menu
Common Startup
Common Templates

To change the location of some fifteen shell folders without moving contents, use TweakUI for Windows XP; go to My Computer>Special Folders, select the shell folder, and change the location. Contents may then be copied or moved in Windows Explorer.

CD Burning
Desktop
Document Templates
Favorites
Installation Path Windows Installer default install folder location
My Documents
My Music
My Pictures
Programs
SendTo
Shared Documents
Shared Music
Shared Pictures
Start Menu
Startup

Probably the easiest way to approach moving shell folders is to try to move the folder in Windows Explorer. If that doesn't work, then try TweakUI and if it isn't available in TweakUI, then edit the appropriate registry key. Don't forget to move the contents manually if you use TweakUI or the registry to change the location.

Windows Explorer puts special labels on the "My Documents" folder for each user account. For example, if an account full-name is "Marion Robertson" as displayed on the Welcome Screen, the My Documents folder is labeled "Marion Robertson's Documents".

The path for each "My Documents" folder is controlled by account-named keys in HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\DocFolderPaths. Windows Explorer also special-labels the account Recent folder to "My Recent Documents", but I have been unable to find the registry key that controls this behavior in order to restore this special status to Recent folders that have lost the magic.

Remembering the Shell Folder locations

If you move your user shell folders, you should save the registry keys in case you need to re-do the changes after a reinstall. The following commands can be used to save these changes to .reg files that can be right-clicked and "merged" into the registry after a reinstall. The following command will backup the current account user shell folders:

C:\>reg "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" UserShellFolders.reg

and to backup the common shell folder locations:

C:\>reg "HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" CommonShellFolders.reg

After a re-install, your user shell folders will be in their default location and empty. You need only merge these .reg files to repoint the shell folders to the location where the files are. No files are moved, nor need to be moved.

Taking Ownership of Folders after a re-install

When you reinstall XP, new accounts are created and you may need to "take ownership" of the old shell folders with the new account(s). This is another KWE help file and more information is available in the XP Help and Support Center. You may need to take ownership of your shell folders before you can access the files.

Reference: http://www.kellys-korner-xp.com/xp_shell_folders.htm

.NET Converter

I've found 2 converter - VB.NET > C# and C# > VB.NET it's quite useful~ let's try.

Hello friends

This is my first post, the following days I'll post some reference link for the design and code sample.
I believe everyone are strong in technical, specially in system architect and coding, so do I. But I want to mention about the layout design, it's a key to success on your application.
Enjoy it.