Método LobSystemCollection.Create
Cria um objeto LobSystem T:Microsoft.Office.Server.ApplicationRegistry.Administration.LobSystem.
Espaço para nome Microsoft.Office.Server.ApplicationRegistry.Administration
Conjunto de Módulos (Assembly) Microsoft.SharePoint.Portal (em microsoft.sharepoint.portal.dll)
A sintaxe
Public Function Create ( _
name As String, _
isCached As Boolean, _
systemUtilityTypeName As String, _
connectionManagerTypeName As String, _
entityInstanceTypeName As String _
) As LobSystem
Dim instance As LobSystemCollection
Dim name As String
Dim isCached As Boolean
Dim systemUtilityTypeName As String
Dim connectionManagerTypeName As String
Dim entityInstanceTypeName As String
Dim returnValue As LobSystem
returnValue = instance.Create(name, isCached, systemUtilityTypeName, connectionManagerTypeName, entityInstanceTypeName)
public LobSystem Create (
string name,
bool isCached,
string systemUtilityTypeName,
string connectionManagerTypeName,
string entityInstanceTypeName
)
Parâmetros
- name
O nome do objeto LobSystem LobSystem.
- isCached
true, se armazenados em cache; caso contrário, false.
- systemUtilityTypeName
"Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbSystemUtility" ou "Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.WebService.WSSystemUtility"
- connectionManagerTypeName
"Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbConnectionManager" ou "Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.WebService.WSConnectionManager"
- entityInstanceTypeName
"Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.Db.DbEntityInstance" ou "Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.WebService.WSEntityInstance"
Retornar valor
Um objeto LobSystem LobSystem.
Exemplo
O seguinte exemplo de código mostra como criar uma instância LobSystem LobSystem e definir parâmetros conexão.
Prerequisites
Certifique-se que um provedor de serviços compartilhados já é criado.
Substituir a constante valor EnterYourSSPNameHere na codificar com o nome do seu Shared Resource Provider.
Project References
Adicione o seguinte referências do projeto no seu projeto código do aplicativo console antes execução neste exemplo:
Microsoft.SharePoint
Microsoft.SharePoint.Portal
Microsoft.Office.Server
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Office.Server.ApplicationRegistry.Administration;
using Microsoft.Office.Server.ApplicationRegistry.Infrastructure;
using WSSAdmin = Microsoft.SharePoint.Administration;
using OSSAdmin = Microsoft.Office.Server.Administration;
namespace Microsoft.SDK.SharePointServer.Samples
{
class GetStartedAndCreateSystem
{
const string yourSSPName ="EnterYourSSPNameHere";
static void Main(string[] args)
{
SetupBDC();
CreateLobSystemAndInstance();
Console.WriteLine("Press any key to exit...");
Console.Read();
}
static void SetupBDC()
{
SqlSessionProvider.Instance().SetSharedResourceProviderToUse(yourSSPName);
}
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("Created a system instance successfully.");
}
}
}
Consulte também
Referência
LobSystemCollection De classe
LobSystemCollection Membros
Microsoft.Office.Server.ApplicationRegistry.Administration De espaço para nome