Archive by Author

SQL 2005 Maintenance Plans and SharePoint

Posted on 11. Sep, 2007 by .

0

If you are using SPS 2003 or MOSS 2007 with a SQL Server 2005 box that does not have SP2 installed, you may discover that your crawls never complete.  There is a bug in SQL 2005 that if you have a Reindex Maintenance Plan it clears some attributes of the SharePoint indexes when it reindexes which in turn breaks the search functionality of SharePoint.  Long story short, consider SP2 for SQL 2005 to be a system requirement of SharePoint.  More information available here:  http://support.microsoft.com/kb/930887

Bookmark and Share

Continue Reading

Life Under a Rock

Posted on 10. Aug, 2007 by .

0

My family and I are having a new house built.  Seems appropriate, as my former abode was located under the following:

Big Rock

You think I’m kidding?  I assure you I am not.  And I offer as proof this tidbit:

Did you know that since Windows 2000 one could mount drives to a folder?  Chances are, you did know that.  Or, you were one of my neighbors.  Did I know that?  I vaguely remembered it, but was absolutely appalled that I have never put it to use. 

Okay, maybe you are in the dark ages with me (please say it is so!), the following article contains additional information:

http://pctoday.com/Editorial/article.asp?article=articles/2005/t0306/06t06/06t06.asp&guid=

I will not take this second chance at mount points lightly.  I am going to emerge from the dark ages of drive letters, I am going to install MOSS 2007 using mount points, and the world will rejoice! 

Stay tuned.  (or return to your rock)

Bookmark and Share

Continue Reading

SharePoint Licensing

Posted on 25. Jun, 2007 by .

0

Lots of people out there are asking the same questions regarding SharePoint licensing. Are CAL’s for concurrent users? Do I need both Standard and Enterprise CAL’s? Can I mix Standard and Enterprise CAL’s in a given environment?

It has been difficult finding definitive responses to these questions, and it seems like if you ask 5 people you get 5 different opinions on the licensing. Finally I ran across this great FAQ from the Microsoft Office group specifically on SharePoint licensing, which answers the above questions and many more:

Microsoft Office SharePoint Server 2007 frequently asked questions – SharePoint Server – Microsoft Office Online

Bookmark and Share

Continue Reading

My First Linq Program

Posted on 18. Jun, 2007 by .

0

I successfully coded my very first LINQ program today, and man is it a doozie!  Observe:

class Program
{
    static void Main(string[] args)
    {
        List<Student> studentList = new List<Student>();

        studentList.Add(new Student("Charlie", "Brown"));
        studentList.Add(new Student("Drew", "Carrie"));

        IEnumerable<Student> students =
            from
                Student
            in
                studentList
            where
                Student.LastName.Equals("Brown")
            select
                Student;

        foreach (Student student in students)
        {
            Console.WriteLine(student.FirstName);
        }

        Console.ReadLine();
    }
}

internal class Student
{
    private string _firstName;
    private string _lastName;

    public Student(string firstName, string lastName)
    {
        _firstName = firstName;
        _lastName = lastName;
    }

    public string LastName
    {
        get { return _lastName; }
        set { _lastName = value; }
    }

    public string FirstName
    {
        get { return _firstName; }
        set { _firstName = value; }
    }
}

 Which when run looks like:

CropperCapture[3]

I’m excited by the possibilities this offers, and am anxious to have an opportunity to explore all LINQ has to offer!

Bookmark and Share

Continue Reading

Safari for Windows!

Posted on 12. Jun, 2007 by .

0

Thank you Apple!  I am now one step closer to retiring my 500MHz iBook!

CropperCapture[2]

Incase you missed it, you can download it here.  This is definitely not a production build, as I have been running it for less than a day and it has crashed 3 times, but it is very, VERY promising!

Bookmark and Share

Continue Reading

SPLimitedWebPartManager Memory Leak?

Posted on 05. Jun, 2007 by .

11

Have a look at the following code segment:

while(true)
{
    using (SPSite siteCollection =
        new SPSite("http://localhost"))
    using (SPWeb site =
        siteCollection.OpenWeb("/Marketing"))
    {
        SPFolder pagesFolder = site.GetFolder("Pages");

        foreach (SPFile page in pagesFolder.Files)
        {
            WL(page.Url);

            using (SPLimitedWebPartManager webPartManager =
                page.GetLimitedWebPartManager
                    (PersonalizationScope.Shared))
            {
            }
        }
    }
}

With this code segment I’m just connecting to a site and iterating over the page collection, grabbing and instance of the page’s SPLimitedWebPartManager as I go. Since SPLimitedWebPartManager implements the IDisposable pattern I am being a good citizen and wrapping its instantiation in a using {} block. The problem with this code segment is that this is what it does to the process memory:

image

Now, if I change the source code to this:

while(true)
{
    using (SPSite siteCollection =
        new SPSite("http://localhost"))
    using (SPWeb site =
        siteCollection.OpenWeb("/Marketing"))
    {
        SPFolder pagesFolder = site.GetFolder("Pages");

        foreach (SPFile page in pagesFolder.Files)
        {
            WL(page.Url);

            using (SPLimitedWebPartManager webPartManager =
                page.GetLimitedWebPartManager
                    (PersonalizationScope.Shared))
            {
                webPartManager.Web.Dispose();
            }
        }
    }
}

The memory picture looks much different now:

image

The only difference being the addition of an explicit Dispose() within the webPartManager using.

A look inside the SPFile.GetLimitedWebPartManager call reveals that it calls an internal GetLimitedWebPartManagerInternal() method on the SPFile SPWeb member variable. A closer look at this method shows the following code:

SPWeb web = this.Site.OpenWeb();
if (this.AllowUnsafeUpdates)
{
    web.AllowUnsafeUpdates = this.AllowUnsafeUpdates;
}
SPWebPartManager manager = web.GetWebPartManagerInternal(pageUrl, requestedView, forRender, includeHidden, out bytes);

We see here that a new SPWeb object is getting spun up, and in the call to GetWebPartManagerInternal an assignment is going to be made to the SPLimitedWebPartManager m_web member variable. If we look at the Dispose() implementation for SPLimitedWebPartManager, we see the following:

public void Dispose()
{
    if (!this.m_disposed)
    {
        if (this.m_manager != null)
        {
            this.m_manager.Dispose();
        }
    }
    else
    {
        return;
    }
    this.m_webParts = null;
    this.m_manager = null;
    this.m_disposed = true;
}

Nothing is being done to dispose of the m_web! If I explicitly dispose of m_web, then memory stays low.

Is anyone encountering the same?

Bookmark and Share

Continue Reading

Exporting DataView with Custom Parameter

Posted on 30. May, 2007 by .

0

This past week I have been working with a DataView that needed to filter a list by the title of the PublishingPage containing the DataView web part.  In order to provide this functionality, I created a straight-forward custom parameter:

public class PageTitleParameter : System.Web.UI.WebControls.Parameter
{
   
protected override object Evaluate(System.Web.HttpContext context, System.Web.UI.Control control)
    {
        SPListItem listItem
= SPContext.Current.ListItem;

        if (listItem != null)
        {
           
try
            {
               
return listItem.Title;
            }
           
catch
            {
               
return string.Empty;
            }
        }

        return string.Empty;
    }
}

Creating custom Parameters has been covered elsewhere, so I won’t bother going into that, it works pretty much the same in SharePoint as in any ASP.NET application.  Where things get different, is after you export your shiny-new DataView web part to SharePoint.  If your experience is anything like mine, when you add your web part to a page instead of seeing your rendered DataView, you see “Parsing Error:  Object reference not set to an instance of an object”.

So what went wrong?  If you look carefully at the parser error, you will likely see that the TagPrefix that you setup when you registered your custom parameter in SharePoint Designer has been replaced with something like “cc3”, “cc4”, etc.  In order to fix this, instead of exporting the web part from SPD straight into SharePoint, save it to a file first.  Open the .webpart file that you saved and add your @Register directive for “cc3” or “cc4” or whatever your custom parameter’s TagPrefix happened to become.  You can now go into the Web Part Gallery and upload your web part. 

Good luck!

Bookmark and Share

Continue Reading

Running ASP.NET app within a SharePoint Virtual Server

Posted on 29. May, 2007 by .

0

For my own development efforts, I use Axosoft’s OnTime product which is free for a single user (yeah!).  I have a single SSL for Axosoft and for my WSS Team Site installation, so I needed for both to coexist peacefully in a single virtual server.  Out of the box Axosoft was throwing several errors, at which point I came across this link from Microsoft: 

How to enable an ASP.Net application to run on a SharePoint virtual server

After completing the steps in the article OnTime began working flawlessly!  Nice!

Bookmark and Share

Continue Reading

Just When You Thought You Knew RDP …

Posted on 23. May, 2007 by .

0

So you have probably used RDP about 5.1 gajillion times, but then you learn something new that shakes your foundation. Well that is what happened to me this past week when I learned 2 new things with RDP, and I am not ashamed to admit it either! Here goes nothing:

Mstsc

What we are looking at here are the command line parameters for MSTSC.EXE, our beloved RDP client. The 2 that jumped out to me this week were /span and /console. /span allows you to have a fullscreen RDP session that spans multiple monitors (difficult one for a screen shot, sorry folks!). The other, /console, allows you to connect to the console session (session 0) on the system, which as you can note above is only possible for Server 2003.

Hmm.. Alright, I confess, maybe it’s 3 things I picked up on this week. Last, but not least (actually probably my favorite for day-to-day), is that there was a Remote Desktops MMC plug-in that snuck into Windows Server 2003. Have a look:

Rdpmmc1

What we have here is the ability to define various RDP server connections, and the connections will actually appear in the view pane. You can then click between the various servers and have it appear in the view pane. This makes it very simple to switch between multiple RDP sessions.

In order to get the Remote Desktops MMC you need to install the ADMINPAK.MSI from the SYSTEM32 folder of a Windows Server 2003.

Bookmark and Share

Continue Reading