I was asked to migrate a Webpart developed MOSS 2007 to Share Point 2010. I have
to code for the webpart. I created a new webpart in VS2010 with the same name as
in 2007, and copied the code from 2007 to 2010. When i build it, was successful
and deployed it and it was also successful. When i go to my site and check it in
the webparts section in site setting i can see the webpart name, the wsp file.
But when i try to open the webpart it gives me en error.
An unexpected error has occurred.
I have attached the code file too.
And when i check the Log Files , i could gather this data
07/23/2011 14:23:52.02 w3wp.exe (0x125C) 0x03D8
SharePoint Foundation Monitoring nasqMedium
Entering monitored scope (Request
(GET:http://a-administrator:80/sites/TestWebParts/_layouts/WPPrevw.aspx?ID=16))
07/23/2011 14:23:52.02 w3wp.exe (0x125C)
0x03D8 SharePoint Foundation Logging Correlation Data xmnvMedium
Name=Request
(GET:http://a-administrator:80/sites/TestWebParts/_layouts/WPPrevw.aspx?ID=16)23\
8c2fb4-634c-4416-bdf2-2f2edb773413
07/23/2011 14:23:52.03 w3wp.exe (0x125C) 0x03D8 SharePoint
Foundation Logging Correlation Data xmnvMedium
Site=/sites/TestWebParts238c2fb4-634c-4416-bdf2-2f2edb773413
07/23/2011 14:23:52.08 w3wp.exe (0x125C) 0x03D8 SharePoint
Foundation Monitoring b4lyHigh Leaving Monitored
Scope (EnsureListItemsData). Execution
Time=10.5542752436727238c2fb4-634c-4416-bdf2-2f2edb773413
07/23/2011 14:23:52.10 w3wp.exe (0x125C) 0x03D8 SharePoint
Foundation Runtime
tkauUnexpectedSystem.ArgumentException: List 'Personnel List' does not exist
at site with URL 'http://a-administrator/sites/TestWebParts'. at
Microsoft.SharePoint.SPListCollection.GetListByName(String strListName, Boolean
bThrowException) at
Microsoft.SharePoint.WebControls.SPDataSourceView.GetList(SPContext context,
SPWeb web, Guid listId, String listName)238c2fb4-634c-4416-bdf2-2f2edb773413
07/23/2011 14:23:52.11 w3wp.exe (0x125C) 0x03D8 SharePoint
Foundation Monitoring b4lyMedium Leaving Monitored
Scope (Request
(GET:http://a-administrator:80/sites/TestWebParts/_layouts/WPPrevw.aspx?ID=16)).
Execution Time=91.3884340787657238c2fb4-634c-4416-bdf2-2f2edb773413
07/23/2011 14:23:52.64 OWSTIMER.EXE (0x1040) 0x1678 SharePoint
Foundation Monitoring b4lyHigh
And i had created the PersonnelList, with data in it.
Below is the code that was used to develop the webpart in 2007. I had copied
this code in to VS2010 to develop the webpart.
<?xml version="1.0" encoding="utf-8"?>
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.DataFormWebPart,
Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="PageSize" type="int">5</property>
<property name="HelpMode" type="helpmode">Modeless</property>
<property name="Height" type="string" />
<property name="SampleData" type="string" null="true" />
<property name="AllowConnect" type="bool">True</property>
<property name="CatalogIconImageUrl" type="string" />
<property name="XslLink" type="string" null="true" />
<property name="AllowClose" type="bool">True</property>
<property name="Hidden" type="bool">False</property>
<property name="MissingAssembly" type="string">Cannot import this Web
Part.</property>
<property name="TitleIconImageUrl" type="string" />
<property name="ChromeState" type="chromestate">Normal</property>
<property name="FireInitialRow" type="bool">True</property>
<property name="Description" type="string">Display top 5 anniversaries
at home page.</property>
<property name="AllowMinimize" type="bool">True</property>
<property name="Xsl" type="string">
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema"
xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0"
exclude-result-prefixes="xsl msxsl ddwrt"
xmlns:ddwrt="schemas.microsoft.com/WebParts/v2/DataView/runtime"
xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
xmlns:__designer="schemas.microsoft.com/.../designer"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:SharePoint="Microsoft.SharePoint.WebControls"
xmlns:ddwrt2="urn:frontpage:internal">
<xsl:output method="html" indent="no"/>