| By Corey Roth | Article Rating: |
|
| November 4, 2009 05:05 PM EST | Reads: |
367 |
Ah, don’t you love COMExceptions? Recently, I was adding two new site columns to a list and encountered a whole slew of errors when trying to create new items in the list. This is the error I got when I was trying to create a custom folder.
System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80040E14
[COMException (0x80040e14): Exception from HRESULT: 0x80040E14]
Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish) +0
Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish) +203
This is the error when I tried to check in a document.
[COMException (0x81020030): The URL 'Lists/MyList/MyDocument.docx' is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.]
Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish) +0
Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish) +203
Lastly, this is the error I got when trying to save a document from Microsoft Word after using the New Document command.
The internet address ‘http://moss-server/Lists/MyList/MyDocument.docx’ is not valid.
Wow! That’s a whole lot of different errors that all are stemming from the same issue. What’s the issue? Well after some quick Google research, I knew it had something to do with duplicate columns. I just added two new columns, so I knew where to start. In this case, I cut and paste one column and changed the values of the DisplayName, Name, and StaticName columns as well as the Id. I figured that should be good, but that was not the case. Look at my two columns and see if you can spot the issue.
<Field Type="Text" DisplayName="MyField1" Required="FALSE" MaxLength="255" Group="Custom" ID="{8e62a2e4-20b9-4689-b379-4674db156b25}" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="MyField1" Name="MyField1" Customization="" ColName="nvarchar20" RowOrdinal="0" />
<Field Type="Text" DisplayName="MyField2" Required="FALSE" MaxLength="255" Group="Custom" ID="{C133215B-053A-4a31-BD1E-724140A4663D}" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="MyField12" Name="MyField2" Customization="" ColName="nvarchar20" RowOrdinal="0" />
Everything might look ok at first, but it won’t look ok if you are familiar with what the ColName attribute does. This specifies the specific field in the underlying database you want that column to use. As you can see in my case, ColName for both fields is set to nvarchar20. This causes a big problem (and all of the errors you see above). Now you ask why on earth would I have ColName specified? Well, that is actually a result of SPSource. I assume, the way it works is by looking at the Schema property of the field when it exports it which contains this extra information. The fix is quite simple. Just remove the ColName attribute and everything will work fine. Again, if you haven’t checked out SPSource yet, I recommend it for exporting content types and lists, but be sure to look over any XML before you use it.
Read the original blog entry...
Published November 4, 2009 Reads 367
Copyright © 2009 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Corey Roth
Corey Roth is a consultant at Stonebridge specializing in SharePoint for clients in the energy sector. He has more than ten years of experience delivering solutions in the energy, travel, advertising and consumer electronics verticals.
Corey specializes in delivering ECM and search solutions to clients using SharePoint. Corey has always focused on rapid adoption of new Microsoft technologies including Visual Studio 2010, .NET Framework 4.0, and Silverlight.
He is a member of the .NET Mafia (www.dotnetmafia.com) where he blogs about the latest technology and SharePoint. He is dedicated to the community and speaks regularly at user groups and SharePoint Saturdays.
- Kindle 2 vs Nook
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- Confessions of a Ulitzer Addict
- Cloud Computing Best Practices
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- GITEX TECHNOLOGY WEEK 2009 Exhibitor Profiles
- Windows 7 – Microsoft’s First Step to the Cloud
- Cloud Computing & Federal IT - What Does the Future Hold?
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Kindle 2 vs Nook
- Practical Approaches for Optimizing Website Performance
- The Difference Between Web Hosting and Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Contrary Opinion: Why Silverlight is Good for Adobe
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- Confessions of a Ulitzer Addict
- Cloud Computing Best Practices
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- WPF Controls by DevExpress
- Google Maps and ASP.NET
- Crystal Reports XI & How It Has Changed
- Converting VB6 to VB.NET, Part I
- Creating Controls for.NET Compact Framework in Visual Studio 2005
- Where Are RIA Technologies Headed in 2008?
- How to Write High-Performance C# Code
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Implementing Tab Navigation with ASP.NET 2.0
- i-Technology Photo Exclusive: Bill Gates & Steve Jobs In "Nerds"
- .NET Archives: Getting Reacquainted with the Father of C#
- i-Technology Viewpoint: "SOA Sucks"
- Programmatically Posting Data to ASP .NET Web Applications






























