Monday, March 5, 2012

Remove one list from other list without loop


var integers = new List<int> { 1, 2, 3, 4, 5 };
            var remove = new List<int> { 1, 3, 5 };
            integers.RemoveAll(i => remove.Contains(i));
            List<string> lis1 = new List<string>() { "1", "2", "3", "4", "5" };
            List<string> lis2 = new List<string>() { "1", "3", "5", "0" };

Thanks
Mahesh K. Sharma

Sunday, March 4, 2012

Office automation setting on server

Retrieving the COM class factory for component with CLSID{000209ff-0000-0000-c000-000000000046} failded due to following error: 80070005 Or document object is null

DCOM Configuration
1.      Click Start -> Run
2.      Enter DCOMCNFG and press OK. This will open the DCOMCNFG window.
3.      Browse down the tree to Console Root -> Component Services -> Computers -> My Computer
4.      Right click on "My Computer" and select properties
5.      Select the "Default Properties" tab
a.      Enable Distributed COM on this computer - Option is checked
b.      Default Authentication Level - Set to Connect
c.       Default Impersonation Level - Set to Identify
6.      Select the "COM Security" tab
7.      Click on Access Permissions ' Edit Default
a.      Add "Anonymous", "Everyone", "Interactive", "Network", "System" with Local and Remote access permissions set.
8.      Click on Launch and Activation Permissions ' Edit Default
a.      Add "Anonymous", "Everyone", "Interactive", "Network", "System" with Local and Remote access permissions set.
9.      Click on OK
10.  Close the DCOMCNFG window

If server is
than
Create desktop folder in following location

C:\Windows\SysWOW64\config\systemprofile\Desktop

C:\Windows\System32\config\systemprofile\Desktop

Thanks
Mahesh K Sharma
Server was Windows 2008 R2, with service pack 1.