Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

cannot convert from 'string' to 'System.Guid'

$
0
0

Hi,

 I am working on a content type project in visual studio 2010 to add a new column field and to delete when a feature is uninstalled. (I am new to sharepoint programming.) when I debugged  the code, got the  the following errors:

Error    2    Argument 1: cannot convert from 'string' to 'System.Guid'  

Error    1    The best overloaded method match for 'Microsoft.SharePoint.SPFieldCollection.Contains(System.Guid)' has some invalid arguments 

public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
        {
            SPWeb web = properties.Feature.Parent as SPWeb;
            string fieldId = "{15332F6E-13E7-40D3-AD71-EC0453D19544}";
            if (web.Fields.Contains (fieldId))
            {
                web.Fields[fieldId].Delete();
            }
        }

any help appreciated.

thanks


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>