# GrapeCity.Documents.Word.Templates.DataSourceDictionary.Add

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="GrapeCity_Documents_Word_Templates_DataSourceDictionary_Add_" data-uid="GrapeCity.Documents.Word.Templates.DataSourceDictionary.Add*">Add Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="GrapeCity_Documents_Word_Templates_DataSourceDictionary_Add_" data-uid="GrapeCity.Documents.Word.Templates.DataSourceDictionary.Add*"></a>
<h4 id="GrapeCity_Documents_Word_Templates_DataSourceDictionary_Add_System_String_System_Object_" data-uid="GrapeCity.Documents.Word.Templates.DataSourceDictionary.Add(System.String,System.Object)">Add(string, object)</h4>
<div class="markdown level1 summary"><p>Adds a data source to this <a class="xref" href="GrapeCity.Documents.Word.Templates.DataSourceDictionary.html">DataSourceDictionary</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Add(string key, object value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Add(key As String, value As Object)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">key</span></td>
      <td><p>The key (name) of the data source to add.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The data source to add.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="implements">Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.idictionary-2.add">IDictionary&lt;TKey, TValue&gt;.Add(TKey, TValue)</a></div>


<a id="GrapeCity_Documents_Word_Templates_DataSourceDictionary_Add_" data-uid="GrapeCity.Documents.Word.Templates.DataSourceDictionary.Add*"></a>
<h4 id="GrapeCity_Documents_Word_Templates_DataSourceDictionary_Add_System_String_System_Object_System_Globalization_CultureInfo_" data-uid="GrapeCity.Documents.Word.Templates.DataSourceDictionary.Add(System.String,System.Object,System.Globalization.CultureInfo)">Add(string, object, CultureInfo)</h4>
<div class="markdown level1 summary"><p>Adds a data source to this <a class="xref" href="GrapeCity.Documents.Word.Templates.DataSourceDictionary.html">DataSourceDictionary</a>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Add(string key, object value, CultureInfo culture)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Add(key As String, value As Object, culture As CultureInfo)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></td>
      <td><span class="parametername">key</span></td>
      <td><p>The key (name) of the data source to add.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The data source to add.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo">CultureInfo</a></td>
      <td><span class="parametername">culture</span></td>
      <td><p>The culture to use when parsing or formatting data from the added data source.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p><code class="paramref">key</code> is null.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentexception">ArgumentException</a></td>
      <td><p>An element with the same key already exists in the <a class="xref" href="GrapeCity.Documents.Word.Templates.DataSourceDictionary.html">DataSourceDictionary</a>.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="GrapeCity_Documents_Word_Templates_DataSourceDictionary_Add_" data-uid="GrapeCity.Documents.Word.Templates.DataSourceDictionary.Add*"></a>
<h4 id="GrapeCity_Documents_Word_Templates_DataSourceDictionary_Add_System_Collections_Generic_KeyValuePair_System_String_System_Object__" data-uid="GrapeCity.Documents.Word.Templates.DataSourceDictionary.Add(System.Collections.Generic.KeyValuePair{System.String,System.Object})">Add(KeyValuePair&lt;string, object&gt;)</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public void Add(KeyValuePair&lt;string, object&gt; item)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub Add(item As KeyValuePair(Of String, Object))</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2">KeyValuePair</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a>, <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a>&gt;</td>
      <td><span class="parametername">item</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
<h5 class="implements">Implements</h5>
    <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.generic.icollection-1.add">ICollection&lt;T&gt;.Add(T)</a></div>
</div>
