Compartilhar via


XML Snippet: Use Batching Filter in a BDC Model

Applies to: SharePoint Server 2010

The following is an example of a batching filter in a BDC model.

Example

<Method IsStatic="false" Name="GetAgentBatched">
  <Properties>
    <Property Name="RdbCommandType" Type="System.Data.CommandType, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">StoredProcedure</Property>
    <Property Name="RdbCommandText" Type="System.String">[dbo].[GetAgentBatched]</Property>
    <Property Name="BackEndObjectType" Type="System.String">SqlServerRoutine</Property>
    <Property Name="BackEndObject" Type="System.String">GetAgentBatched</Property>
    <Property Name="Schema" Type="System.String">dbo</Property>
  </Properties>
  <FilterDescriptors>
    <FilterDescriptor Type="Batching" FilterField="@BatchId" Name="BatchId" />
  </FilterDescriptors>
  <Parameters>
    <Parameter Direction="InOut" Name="@BatchId">
      <TypeDescriptor TypeName="System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]" AssociatedFilter="BatchId" Name="@BatchId">
        <DefaultValues>
          <DefaultValue MethodInstanceName="GetAgentBatched" Type="System.Int32">1</DefaultValue>
        </DefaultValues>
      </TypeDescriptor>
    </Parameter>
    <Parameter Direction="Return" Name="GetAgentBatched">
      <TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="GetAgentBatched">
        <TypeDescriptors>
          <TypeDescriptor TypeName="System.Data.IDataRecord, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" Name="GetAgentBatchedElement">
            <TypeDescriptors>
              <TypeDescriptor TypeName="System.Int32" Name="AgentID" />
              <TypeDescriptor TypeName="System.String" Name="AgentName">
                <Properties>
                  <Property Name="Size" Type="System.Int32">100</Property>
                </Properties>
                <Interpretation>
                  <NormalizeString FromLOB="NormalizeToNull" ToLOB="NormalizeToNull" />
                </Interpretation>
              </TypeDescriptor>
              <TypeDescriptor TypeName="System.Nullable`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]" Name="ArtistID" />
              <TypeDescriptor TypeName="System.Int32" ReadOnly="true" IdentifierName="ID" Name="ID" />
            </TypeDescriptors>
          </TypeDescriptor>
        </TypeDescriptors>
      </TypeDescriptor>
    </Parameter>
  </Parameters>
  <MethodInstances>
    <MethodInstance Type="Finder" ReturnParameterName="GetAgentBatched" Default="true" Name="GetAgentBatched" DefaultDisplayName="Agent Read List">
      <Properties>
        <Property Name="UseClientCachingForSearch" Type="System.String"></Property>
        <Property Name="RootFinder" Type="System.String"></Property>
      </Properties>
    </MethodInstance>
  </MethodInstances>
</Method>