I have created a .net web part and deployed it on the sharepoint site. When I preview it, the sharepoint throws up an error saying "An error occured when previewing the Web Part"
The code in the web part is as follows
Dim myweb As Microsoft.SharePoint.SPWeb = Microsoft.SharePoint.WebControls.SPControl.GetContextWeb(Context)
'Dim mylist As Microsoft.SharePoint.SPList = myweb.Lists(System.Configuration.ConfigurationSettings.AppSettings("BedList").ToString())
Dim mylist As Microsoft.SharePoint.SPList = myweb.Lists("{80F6F320-E1F5-42EB-A2FB-895EAE00F589}")
Dim items As Microsoft.SharePoint.SPListItemCollection = mylist.Items
For Each item As Microsoft.SharePoint.SPListItem In items
returnString = returnString + "<br/>" + item("Status").ToString() + " For " + item("Title").ToString + "<br/>"
Next
Does anyone know why this would not work. I can not get hold of the execption thrown. any help would be greatful