使用 Siebel 在 Business Services 上运行 EXECUTE 操作
本部分演示如何使用适用于 Siebel eBusiness 应用程序的 .NET Framework 数据提供程序在 Siebel 业务服务上执行操作。
执行 Siebel Business Service
本部分演示如何对 Siebel 存储库中的业务服务执行操作。
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.Common;
using System.Data;
using Microsoft.Adapters.SiebelDbProvider;
namespace SiebelADOBS
{
class Program
{
static void Main(string[] args)
{
try
{
SiebelProviderFactory factory = SiebelProviderFactory.Instance;
DbConnection connection = factory.CreateConnection();
connection.ConnectionString = "Username=SADMIN;Password=SADMIN;ServiceUri=172.23.115.223:2321;SiebelObjectManager=SSEObjMgr;SiebelEnterpriseServer=ent771;Language=enu;SiebelRepository=Siebel Repository";
connection.Open();
DbCommand command = connection.CreateCommand();
command.CommandText = "EXEC ExtractDataService.Echo @In, @InOut, @Out OUTPUT";
//Add @In
DbParameter param1 = command.CreateParameter();
param1.ParameterName = "@In";
param1.Direction = ParameterDirection.Input;
param1.Value = "SomethingElse";
command.Parameters.Add(param1);
//Add @InOut
DbParameter param2 = command.CreateParameter();
param2.ParameterName = "@InOut";
param2.Direction = ParameterDirection.InputOutput;
command.Parameters.Add(param2);
//Add @Out
DbParameter outParam = command.CreateParameter();
outParam.ParameterName = "@Out";
outParam.Direction = ParameterDirection.Output;
command.Parameters.Add(outParam);
DbDataReader dbReader = command.ExecuteReader();
Console.WriteLine("Param2: " + param2.Value);
Console.WriteLine("OutParam: " + outParam.Value);
Console.WriteLine("Press any key...");
Console.ReadLine();
}
catch (Exception exp) { Console.WriteLine(exp.Message); }
}
}
}
另请参阅
使用用于 Siebel eBusiness 应用程序的 .NET Framework 数据提供程序
使用 Siebel 对业务组件运行 SELECT 查询