Blog Home  Home Feed your aggregator (RSS 2.0)  
My DasBlog! - Wednesday, June 22, 2005
newtelligence powered
 
# Wednesday, June 22, 2005

Jan Tielens has posted a nice article about adding WebParts to a WebPartPage programmatically in SharePoint. In his article he discusses two scenarios to accomplish this.

  • First scenario is getting the is creating a new WebPart (in his case a ListViewWebPart) and adding it to the SPWebPartCollection.
  • Second scenario is building a XML string containing the information about the WebPart and use the SPWebPartCollection to add this string.

http://weblogs.asp.net/jan/archive/2005/06/22/414283.aspx

Wednesday, June 22, 2005 4:09:16 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SharePoint  | 

At the blog #region /* mads's thoughts */ an important article is found called "COM objects need tight leash". It gives an example of increasing memory usage when working with the SharePoint object model and th Office interop components.

In that case it seems that the Garbage Collector was cleaning up the managed references which were wrappers around COM objects and these COM objects were not cleaned up.

I have had a similair problem in the past writing wrapper classes in C# around C++ unmanaged code. The unmanaged code was not cleaned up by the garbage collector ofcourse and you had to do that yourself.

http://weblogs.asp.net/mnissen/archive/2005/06/22/414247.aspx
Wednesday, June 22, 2005 10:50:05 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   .NET | C# | SharePoint  | 

It never hurts to mention this again. Be very carefull when calling the Dispose or Close method on SPSite or SPWeb objects. If the object is a shared resource it will give you a nasty "access violation error". For example never do the following:

SPSite site = SPControl.GetContextSite (this.Context);
// Code to perform a task
site.Dispose ();  -> WRONG

SharePoint will dispose the object if needed so never call the Dispose method in this case. If you create your own SPSite or SPWeb objects you can use the Dispose or the Close method for these objects. In case you're referencing the object never ever call the Dispose or Close method.

See the article referred to below:

http://www.kbalertz.com/kb_901259.aspx

Wednesday, June 22, 2005 9:57:18 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SharePoint  | 
# Tuesday, June 21, 2005

Some other bloggers already mentioned it that Scott Handelsman has updated a tool list. This list called "Scott Hanselman's 2005 Ultimate Developer and Power Users Tool List" contains an impressive list of tools containing something for everybody.

You have to take a look at the following:

Lutz's Reflector and it's AddIns - The tool that changed the world and the way we learn about .NET. Download it, select and interesting method and hit the space bar. Take the time to install the Add-Ins and check out the amazing static analysis you can do with things like the Diff and Graph.

TestDriven.NET (was NUnitAddIn) - The perfect integration of Unit Testing with Visual Studio.NET. Right click and "Run Test." The output window says "Build" then switches to "Test." The best part, though, is "Test With...Debugger" as a right click that automatically starts up an external process runner, loads and starts your test. Compatible with NUnit, MBUnit and Team System.

Eric J Smith's CodeSmith - Oh, yes, it's much more than just a Strongly Typed Collection Generator. It's a complete code-generation engine with an ASP.NET-like syntax. Very extendable, very powerful, very affordable. And all is right with the world. I've used it to generate THOUSANDS of lines of code. There's a learning curve, but the benefits are immense. It's worth the download just for the Strongly Typed Collection code from Chris Nahr. 

ASP.NET Development Helper - Nikhil, a dev lead on ASP.NET 2.0, created this wonderfully elegant developer helper that plugs into IE and gives you lots of insight into what's happening in ASP.NET while you develop. Want a FireFox version? Sure.

And many more :)

http://www.hanselman.com/blog/ScottHanselmans2005UltimateDeveloperAndPowerUsersToolList.aspx

Tuesday, June 21, 2005 7:19:38 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]    | 
# Monday, June 20, 2005

When you create sites programatically they will not show up in the site directory list. I found an article at the website of SPSFAQ with a coding example which will resolve this problem. They got the article from MSD2D. The code is as follows:

//Get reference to the portal
SPSite myPortal = new SPSite("http://localhost);
SPWeb myWeb=portal_site.AllWebs["SiteDirectory"];
SPListCollection myWeblists=myWeb.Lists;

//Get reference to the site directory
SPList siteDir= myWeblists["Sites"];

//Add an new entry
SPListItemCollection listItems = siteDir.Items;
SPListItem item = listItems.Add();

//Assign values to the list columns
item["Title"] = objCommunity.Name;
item["Description"] = objCommunity.Purpose;

//update the new list item
item.Update();

http://www.spsfaq.com/customising.asp?page=8  (SPSFAQ0302106)

Monday, June 20, 2005 3:43:18 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SharePoint  | 

Maurice Prather has written a nice article about the recommended way of validating WebPart properties. According to him there are two reasons why you should put the validation in the property's set method namely:

  • Performance
  • Better visibility of error conditions

I agree with him especially looking at the performance. To read the article follow the link below:

http://www.bluedoglimited.com/SharePointThoughts/ViewPost.aspx?ID=178
Monday, June 20, 2005 9:07:29 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SharePoint  | 
# Thursday, June 16, 2005
This is a simple tutorial for adding a new user to give access to the "Scorecard Development Site". This website is de maintainance tool voor de Microsoft Office Business Scorecard Accelerator (MOBSA). Here you can maintain scorecards, KPI's, KPI groups and lots of other stuff.

Thursday, June 16, 2005 1:47:44 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SharePoint  | 
# Wednesday, June 15, 2005

On the blog of Erol Giraudy i found a link to sample course material for SharePoint 2003 training. As stated on the SharePoint Solutions website:

"All sample course materials are property of SharePoint Solutions and subject to copyright laws. The sample course materials are provided for evaluation purposes only. They may not be copied and/or distributed to any person other than the individual registering on this page."

http://www.sharepointsolutions.com/dwnld8765cg01lpm33324.html

Wednesday, June 15, 2005 9:32:21 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SharePoint  | 

I got a question from Amit Vasu regarding the installation of SharePoint Portal Server 2003 with SQL Server versus MSDE. The issue was that his customer first wanted to use MSDE and if needed later on migrating to SQL Server.

This is possible and i did some investigation on MSDN and found the following. There is an article describing the migration from WMSDE to SQL Server:

http://www.microsoft.com/resources/documentation/wss/2/all/adminguide/en-us/stsf17.mspx

After this you have to change the connections in SharePoint Administration of the databases. the following walkthrough describes it:

Open the SharePoint Central Administration website and go to the "Windows SharePoint Services Central Administration". You will find under "Server Configuration" the option "Set configuration database server". Here you can change the configuration database to its new location.

Go to the "SharePoint Portal Server Central Administration". You will find under "Server Configuration" the option "Configure server topology". Here you change the content, component settings and configuration database to their new location.

Wednesday, June 15, 2005 9:20:19 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0]   SharePoint | SQL Server  | 
Copyright © 2012 Alexander Meijers. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: