Migrate List with cl column to Foundation 2010

Oct 20, 2010 at 11:40 AM

Hi,

first of all thanks for this nice solution.

Currently i'm triing to migrate my List from WSS3.0 to the new foundation Platform with a migration tool. Unfortunally this tool has a problem with this custom column.

What i tried is to write a litte program in c# which just copies the value of the connected lookup columns into a text field an the migrate the list. This code works with every other

list column but not with the CL. Do you have any idea of how to access the values from the CL column via code ?

Greets

Marco

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using System.Configuration;
namespace UpdateSPList
{
     class Program
     {
          static void Main(string[] args)
          {
               SPSite site = new SPSite("http://myserver/main");
               SPWeb web = site.OpenWeb();
               SPList list = web.Lists["mylist"];
              

               web.AllowUnsafeUpdates = true;
               foreach (SPListItem item in list.Items)
       {

          
           item["copyofconnectedlookup"] = item["originalconnectedlookup"];
          

           item.SystemUpdate(false);
           list.Update();

       }
              web.AllowUnsafeUpdates = false;
          }
     }


}