Click here to Skip to main content
15,912,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I am getting error while submitting controls values to the list from sharepoint webpart

web part error unhandled exception was thrown by the sandboxed code wrapper's execute method in the partial trust app Domain : as unexpected error has occured Correlation id :
C#
SPSite site = new SPSite("http://Myservername:4143/Lists/SaveMyCustomerServiceList/");
                site.AllowUnsafeUpdates = true;
                SPWeb web = site.OpenWeb();               
                SPList list = web.GetList("SaveMyCustomerServiceList");                                           
                SPListItem item = list.Items.Add();
                item["Title"] = "My Customer";
                item["Policy Types"] = Convert.ToString(ddPolicyType.SelectedItem.Text);
                item["Policy No"] = Convert.ToString(txtPolicyNo.Text);
                item["Name"] = Convert.ToString(txtName.Text);
                item["Date Of Birth"] = Convert.ToString(txtDOB.Text);
                item["Customer Contact No."] = Convert.ToString(txtMobileNo.Text);
                item["Email ID"] = Convert.ToString(txtEmailId.Text);
                item["Category"] = Convert.ToString(ddlCategory.SelectedItem.Text);
                item["Comments"] = Convert.ToString(txtComments.InnerText);
                item.Update();
Posted
Comments
ZurdoDev 6-Feb-14 8:15am    
A simple google search resulted in http://social.technet.microsoft.com/Forums/sharepoint/en-US/70fee510-dc16-491a-940c-8ee58e8a5745/an-unexpected-error-has-occurred-troubleshoot-issues-with-microsoft-sharepoint?forum=sharepointgeneralprevious

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900