Share via


LobSystemInstanceCollection.Create Method (String, Boolean)

Creates an LOBSystemInstance object.

Namespace:  Microsoft.Office.Server.ApplicationRegistry.Administration
Assembly:  Microsoft.SharePoint.Portal (in Microsoft.SharePoint.Portal.dll)

Syntax

'Declaration
Public Function Create ( _
    name As String, _
    isCached As Boolean _
) As LobSystemInstance
'Usage
Dim instance As LobSystemInstanceCollection
Dim name As String
Dim isCached As Boolean
Dim returnValue As LobSystemInstance

returnValue = instance.Create(name, isCached)
public LobSystemInstance Create(
    string name,
    bool isCached
)

Parameters

Return Value

Type: Microsoft.Office.Server.ApplicationRegistry.Administration.LobSystemInstance
The LOBSystemInstance object.

Examples

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint.Administration;
using Microsoft.Office.Server.ApplicationRegistry.Administration;
using Microsoft.Office.Server.Administration;
using Microsoft.Office.Server.ApplicationRegistry.Infrastructure;
using System.IO;
using System.Xml;

namespace BDCom
{
    class Program
    {
        static void Main(string[] args)
        {
            SetupBDC();
            CreateLobSystemAndInstance();
            Console.Read();
        }
        static void SetupBDC()
        {
            SqlSessionProvider.Instance().SetSharedResourceProviderToUse("EnterYourSSPNameHere");
        }
        static void CreateLobSystemAndInstance()
        {
            LobSystem system = ApplicationRegistry.Instance.LobSystems.Create("AdventureWorksSampleFromCode", true, "Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbSystemUtility", "Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbConnectionManager", "Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbEntityInstance");

            LobSystemInstance sysInstance = system.LobSystemInstances.Create("AdventureWorksSampleFromCode", true);

            sysInstance.Properties.Add("AuthenticationMode", (Int32)Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAuthenticationMode.PassThrough);

            sysInstance.Properties.Add("DatabaseAccessProvider", (Int32)Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbAccessProvider.SqlServer);

            sysInstance.Properties.Add("RdbConnection Data Source", "YourAdvWorks2000ServerNameHere");

            sysInstance.Properties.Add("RdbConnection Initial Catalog", "AdventureWorks2000");

            sysInstance.Properties.Add("RdbConnection Integrated Security", "SSPI");

            sysInstance.Properties.Add("RdbConnection Pooling", "false");

            sysInstance.Properties.Add("WildCardCharacter", "%");

            sysInstance.Update();
            Console.WriteLine("Done");

        }
   }
}

See Also

Reference

LobSystemInstanceCollection Class

LobSystemInstanceCollection Members

Create Overload

Microsoft.Office.Server.ApplicationRegistry.Administration Namespace