SharePoint中。外部内容类型。将值传递给存储过程

时间:2013-02-09 19:35:20

标签: sharepoint stored-procedures sharepoint-2010 bdc

我有简单的存储过程,需要一对参数和更新表。

如何通过BDC传递参数?

例如,要执行存储过程,选择行并采用一个参数,代码如下。

        BdcService bdcservice = SPFarm.Local.Services.GetValue<BdcService>();
        IMetadataCatalog catalog = bdcservice.GetDatabaseBackedMetadataCatalog(SPServiceContext.Current);
        //  entity.GetLobSystem().GetLobSystemInstances()[0].Value;
        IEntity entity = catalog.GetEntity(Utils.EntityNamespace, "GetMessage");
        ILobSystemInstance lobSystemInstance = entity.GetLobSystem().GetLobSystemInstances()[0].Value;

        IFilterCollection filters = entity.GetDefaultFinderFilters();
        ComparisonFilter filter = (ComparisonFilter)filters[0];
        filter.Value = code;
        IEntityInstanceEnumerator enumerator = entity.FindFiltered(filters, lobSystemInstance);
        DataTable result = entity.Catalog.Helper.CreateDataTable(enumerator);

DataTable结果包含选定的行。

但是如何将couple参数传递给Update过程?

 BdcService bdcservice = SPFarm.Local.Services.GetValue<BdcService>();
        IMetadataCatalog catalog = bdcservice.GetDatabaseBackedMetadataCatalog(SPServiceContext.Current);
        //  entity.GetLobSystem().GetLobSystemInstances()[0].Value;
        IEntity entity = catalog.GetEntity(Utils.EntityNamespace, "ContractAdd");
        ILobSystemInstance lobSystemInstance = entity.GetLobSystem().GetLobSystemInstances()[0].Value;


       // entity.ExecuteScalar();

实体有方法“ExecuteScalar”,但是如何通过这种方法传递params?

0 个答案:

没有答案