Friday, August 15, 2014

Ctrl, Alt or Shift button of Type Cover 2 are getting stuck

It happens quite frequent in my Surface Pro 2.  I have to press these buttons several times to release it.  I disabled the driver "Microsoft Input Configuration Device" in the device manager. Seems it works well without losing any critical keyboard functionality.

http://answers.microsoft.com/en-us/surface/forum/surfpro2-surfhardware/sticking-keys-workaround/44f96c86-d653-407a-a694-86acfa53cda0?rtAction=1401207289238

Friday, December 30, 2011

How to underline a accesskey for asp:button

Using in asp:Button in not work.  You may button.


Instead of:




Please use:



Result: 

       



Error 401.1 "Unauthorized: Access is denied due to invalid credentials"

Have developed a ASP.NET application, in which it will call a web service from another web application but within the same IIS server. Everything is fine until putting those into production server.

The web service requires Windows authentication.  Error 401.1 "Unauthorized: Access is denied due to invalid credentials" occur even we pass the correct user name, password.  We ensure the account is not locked.

After Googling, we found that it happens on Windows 2003 Server SP1, IIS6 with integrated authentication enabled.

http://support.microsoft.com/kb/896861

Above KB describe the solution about the loopback issue, I am not repeating there.  The most important thing is it happens to some host name only, not all.

After we do some testing, we find that if the host name is CNAME in our DNS, it works.  But if we set to A (IP address), then no luck.

Example:
name1.mydomain.com -> WEBSERVER01.LOCAL (CNAME)
name2.mydomain.com -> 192.168.1.2 (A)

No problem for name1.mydomain.com, but same problem withe above KB for name2.mydomain.com


Tuesday, June 28, 2011

Fix: User, group, or role already exists in the current database. (Microsoft SQL Server, Error: 15023)

Run following T-SQL Query in Query Analyzer to associate login with the username. ‘Auto_Fix’ attribute will create the user in SQL Server instance if it does not exist. In following example ‘ColdFusion’ is UserName, ‘cf’ is Password. Auto-Fix links a user entry in the sysusers table in the current database to a login of the same name in sysxlogins.

USE YourDB
GO
EXEC sp_change_users_login 'Auto_Fix', 'ColdFusion', NULL, 'cf'
GO



Reference: http://blog.sqlauthority.com/2007/02/15/sql-server-fix-error-15023-user-already-exists-in-current-database/

Thursday, May 19, 2011

C#: Format number to string with comma separated with thousand place

int number = 1000000000;
string whatYouWant = number.ToString("#,##0");
//You get: 1,000,000,000