9 March 2010 0 Comments

Government Coud Computing

Everybody is talking about clouds these days but really the choice to move to the cloud is not an all-or-nothing proposition. With different types of cloud offerings, you have flexible options about which services to obtain in the cloud and which to keep on site.

5 March 2010 0 Comments

Code snippet to copy documents from one document library to another

1: using (SPSite site = new SPSite( "http://ms10:200/sites/200" )) 2: { 3: using (SPWeb web = site.OpenWeb()) 4: { 5: SPList lib1 = (SPDocumentLibrary)web.Lists[ "Documents" ]; 6: SPList lib2 = (SPDocumentLibrary)web.Lists[ "Site Collection Documents" ]; 7: byte [] fileBytes = null ; 8: string destUrl = null ; 9: SPFile destFile = null ; 10: foreach (SPListItem item1 in lib1.Items) 11: { 12: fileBytes = item1.File.OpenBinary(); 13: destUrl = lib2.RootFolder.Url + "/" + item1.File.Name; 14: destFile = lib2.RootFolder.Files.Add(destUrl, fileBytes, true /*overwrite*/ ); 15:   16: fileBytes = null ; 17: destUrl = null ; 18: destFile = null ; 19: } 20:   21: lib1 = null ; 22: lib2 = null ; 23: } 24: } 25: MessageBox.Show( "Done!" );

5 March 2010 0 Comments

Code snippet to create a Tasks list and associate it with a Parallel Approval workflow in a Pages library

The requirement to write this code was, After export/import, workflow modification for approvers was failing. Approvers were not able to perform the Approval workflow operations and then we tested that if we create a new Tasks list and modify the existing Approval workflow association then everything starts working so we needed a code which can do this operation for whole site collection. Following code snippet will create a Tasks list with name “MS Tasks” and associate it with a Parallel Approval workflow in a “Pages” library in root site as well as in all the sub sites.

20 February 2010 0 Comments

Here am I.

It’s a new beginning to writing my thoughts/ideas on MSDN Blog. Wish this will help you.

14 January 2010 0 Comments

VS2010 Guidance now published!

After a long journey, the work I did along with others has finally paid off.   The VS2010 Guidance is now available on codeplex.  I worked on the developer (database) portions.  I hope everyone enjoys the hard work. Reference: http://vs2010quickref.codeplex.com/