Pergunta

I am trying to create external content type programmatically with SharePoint 2010. Here is the MSDN link which I am using for reference.

I have created a console application and put the same code as provided. But I am facing issue in below line:

// Make a new Contact LobSystem
            // NOTE: Assume that the "AdventureWorks" LobSystem 
            // does not already exist.
            LobSystem adventureWorksLobSystem = 
                contactModel.OwnedReferencedLobSystems.Create(
                "AdventureWorks", true, SystemType.Database);

I am not able to pass value of SystemType.Database. I am not able to find what could be the use of it as well as how can I pass that value. Can anyone tell me what should be the value and how to pass it?

Thanks in advance.

Foi útil?

Solução

You need to add reference of Microsoft.BusinessData.dll. Then add namespace Microsoft.BusinessData.MetadataModel. This will enable you to use access SystemType enum.You can use different values of this enum like SystemType.DataBase,SystemType.WebService,SystemType.Custom,SystemType.Wcf,SystemType.DotNetAssembly.Please refere this link for more details.Hope this will work for you.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top