Posts

Showing posts from August, 2012

Are two SQL Server Connection Strings equal?

using  System.Data.SqlClient; public   static   bool  AreEqual( string  connectionString1,  string  connectionString2)         {              SqlConnectionStringBuilder  connection1 =  new   SqlConnectionStringBuilder (connectionString1);              SqlConnectionStringBuilder  connection2 =  new   SqlConnectionStringBuilder (connectionString2);              if  ((connection1.InitialCatalog.ToLower() == connection2.InitialCatalog.ToLower() ||                  connection1.AttachDBFilename.ToLower() == connection2.AttachDBFilename.ToLower()) &&                 connection1.DataSource.ToLower() == connection2.DataSource.ToLower())             {                  return   true ;             }              else             {                  return   false ;             }         }

Why tracking table in MS sync framework is not fully correct.

We cannot use another table as a stand-in to track changes in a base table. This is because if we update the tracking table tomorrow, that increments the timestamps. In reality, if we are tracking changes to a table, that table itself should have the timestamp column, so that, sync works properly, and does not do more than what it is supposed to do.

Why a developer has to worry about windows updates...

Sometimes the unknown errors thrown by the operating system or plain wrong error messages are corrected and show the actual underlying error with the latest windows updates. Happened too many times with me for it to be a coincidence.

How to increase dpi settings on a server which does not have a video card to support Aero

http://social.microsoft.com/Forums/en/whatforum/thread/282a63c2-bd57-4639-811b-c03c6b82b49b Use the above article and the registry setting mentioned there, increase the text size to use a higher % than 100, then logout. When you log back in via remote desktop from a machine which has an aero enabled graphics card, it will make the text much clearer. Update: You have to set windows to use full blown aero mode with settings for best display rather than best performance. Otherwise, this will not work properly. [HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM] "Composition"=dword:00000001 "CompositionPolicy"=dword:00000000 "ColorizationOpaqueBlend"=dword:00000000 "EnableAeroPeek"=dword:00000001 "AlwaysHibernateThumbnails"=dword:00000000 "UseDpiScaling"=dword:00000000 So I can read register table to get the setting is set or not private bool IsDpiScaling() {     RegistryKey k= Registry.CurrentUser.OpenSubKey

WCF Call breaking when some of the dlls are obfuscated...

You get an error with the following words in it: "WCF obfuscated dll Error line position Element _BackingField from namespace not expected" A moron once told me that there is no need to put DataContract and DataMember attributes for the entity objects anymore. I did not listen, he went ahead and stopped putting it in. Turns out, if any of the moron's entity classes are modified to add more fields later, the WCF call to the server which takes the entity breaks with this weird error. Looks like the obfuscator handles classes with these attributes while it creates problems when the class does not have the attribute. This is why whenever we ran code with obfuscation it failed, while the code without obfuscation from the exact same source code works fine. REF:  http://stackoverflow.com/questions/5921635/is-datacontract-attributes-required-for-wcf