Message-ID: <1106710952.7721.1711619092844.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_7720_623854458.1711619092844" ------=_Part_7720_623854458.1711619092844 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html WordTemplate.SetDataSource(System.Collections.IDictionary, Strin= g)

WordTemplate.SetDataSource(System.Collections.IDictionary, String)<= /h1>

Description

=20

Sets a template's main document data source to an IDictionary collection. An IDictionary represents a collection of key-and-value pairs.

=20
C#
=20
 public void SetDataSource(System.Collections.IDictionary dataSource, Syste=
m.String dataSourceName)
=20
=20
vb.net
=20
Public Sub SetDataSource(ByVal dataSource As System.Collections.IDictionary=
, ByVal dataSourceName As String)
=20
=20

Parameters

=20
dataSource
An=20 IDictionary collection of key-and-value pairs.=20
datSourceName
The name of the set of template merge fi= elds at which to insert the values imported from the data source.=20

Exceptions

=20
ArgumentNullException
=20 Save will t= hrow this exception if=20 null (C#) or=20 Nothing (VB.NET) is passed to the method.=20
ArgumentException
=20

Remarks

Each merge field in a WordWriter template must bind = to a data source field/value pair. The number of merge fields in the main t= emplate document (the part of the document that is not within a repeat bloc= k) may not exceed the number of values in the data source defined by=20 SetDat= aSource. However, the number of values in the data source may be greate= r than the number of merge fields in the main template document.=20

Examples

=20
C#
=20

          wTempl.SetDataSource(coll, "Products");
        
=20
=20
vb.net
=20

          wTempl.SetDataSource(coll, "Products")
        
=20
------=_Part_7720_623854458.1711619092844--