Merge pull request #943 from ermshiperete/bug-novell-325669
[mono.git] / mcs / class / System.Data / Documentation / en / System.Data.Odbc / OdbcConnectionStringBuilder.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <Type Name="OdbcConnectionStringBuilder" FullName="System.Data.Odbc.OdbcConnectionStringBuilder">
3   <TypeSignature Language="C#" Value="public sealed class OdbcConnectionStringBuilder : System.Data.Common.DbConnectionStringBuilder" />
4   <AssemblyInfo>
5     <AssemblyName>System.Data</AssemblyName>
6     <AssemblyVersion>2.0.0.0</AssemblyVersion>
7   </AssemblyInfo>
8   <Base>
9     <BaseTypeName>System.Data.Common.DbConnectionStringBuilder</BaseTypeName>
10   </Base>
11   <Interfaces />
12   <Attributes>
13     <Attribute>
14       <AttributeName>System.ComponentModel.TypeConverter("System.Data.Odbc.OdbcConnectionStringBuilder+OdbcConnectionStringBuilderConverter, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")</AttributeName>
15     </Attribute>
16     <Attribute>
17       <AttributeName>System.ComponentModel.DefaultProperty("Driver")</AttributeName>
18     </Attribute>
19   </Attributes>
20   <Docs>
21     <remarks>
22       <attribution license="cc4" from="Microsoft" modified="false" />
23       <para>The connection string builders let developers programmatically create syntactically correct connection strings, and parse and rebuild existing connection strings, using properties and methods of the class. The connection string builder provides strongly typed properties corresponding to the known key/value pairs allowed by ODBC connections, and developers can add arbitrary key/value pairs for any other connection string values. </para>
24       <para>Developers needing to create connection strings as part of applications can use the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> class to build and modify connection strings. The class also makes it easy to manage connection strings stored in an application configuration file. <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> performs checks only for the limited set of known key/value pairs. Therefore, this class can be used to create invalid connection strings. The following table lists the specific known keys together with their corresponding properties within the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> class, and their default values. Besides these specific values, developers can add any key/value pairs to the collection that is contained within the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> instance.</para>
25       <list type="table">
26         <listheader>
27           <item>
28             <term>
29               <para>Key</para>
30             </term>
31             <description>
32               <para>Property</para>
33             </description>
34             <description>
35               <para>Comment</para>
36             </description>
37             <description>
38               <para>Default value</para>
39             </description>
40           </item>
41         </listheader>
42         <item>
43           <term>
44             <para>Driver</para>
45           </term>
46           <description>
47             <para>
48               <see cref="P:System.Data.Odbc.OdbcConnectionStringBuilder.Driver" />
49             </para>
50           </description>
51           <description>
52             <para>Developers should not include the braces surrounding the driver name when they set the <see cref="P:System.Data.Odbc.OdbcConnectionStringBuilder.Driver" /> property. The <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> instance adds braces as needed. </para>
53           </description>
54           <description>
55             <para>Empty string</para>
56           </description>
57         </item>
58         <item>
59           <term>
60             <para>DSN</para>
61           </term>
62           <description>
63             <para>
64               <see cref="P:System.Data.Odbc.OdbcConnectionStringBuilder.Dsn" />
65             </para>
66           </description>
67           <description>
68             <para>  </para>
69           </description>
70           <description>
71             <para>Empty string</para>
72           </description>
73         </item>
74       </list>
75       <para>If any value (other than the <see cref="P:System.Data.Odbc.OdbcConnectionStringBuilder.Driver" /> value) within the connection string contains a semicolon (;), the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> surrounds the value with quotation marks in the connection string. In order to avoid this issue with the <see cref="P:System.Data.Odbc.OdbcConnectionStringBuilder.Driver" /> value that frequently contains a semicolon, the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> class always surrounds this value with braces. The ODBC specification indicates that driver values that contain semicolons must be surrounded with braces, and this class handles this for you.</para>
76       <para>The <see cref="P:System.Data.Odbc.OdbcConnectionStringBuilder.Item(System.String)" /> property handles attempts to insert malicious code. For example, the following code, using the default <see cref="P:System.Data.Odbc.OdbcConnectionStringBuilder.Item(System.String)" /> property (the indexer, in C#) correctly escapes the nested key/value pair.</para>
77       <para>[Visual Basic]</para>
78       <code>Dim builder As _
79  New System.Data.Odbc.OdbcConnectionStringBuilder
80 ' Take advantage of the Driver property. 
81 builder.Driver = "SQL Server"
82 builder("Server") = "MyServer;NewValue=Bad"
83 Console.WriteLine(builder.ConnectionString)</code>
84       <para>[C#]</para>
85       <code>System.Data.Odbc.OdbcConnectionStringBuilder builder = 
86   new System.Data.Odbc.OdbcConnectionStringBuilder();
87 // Take advantage of the Driver property. 
88 builder.Driver = "SQL Server";
89 builder["Server"] = "MyServer;NewValue=Bad";
90 Console.WriteLine(builder.ConnectionString);</code>
91       <para>The result is the following connection string that handles the invalid value in a safe manner:</para>
92       <code>Driver={SQL Server};Server="MyServer;NewValue=Bad"</code>
93     </remarks>
94     <summary>
95       <attribution license="cc4" from="Microsoft" modified="false" />
96       <para>Provides a simple way to create and manage the contents of connection strings used by the <see cref="T:System.Data.Odbc.OdbcConnection" /> class.</para>
97     </summary>
98   </Docs>
99   <Members>
100     <Member MemberName=".ctor">
101       <MemberSignature Language="C#" Value="public OdbcConnectionStringBuilder ();" />
102       <MemberType>Constructor</MemberType>
103       <AssemblyInfo>
104         <AssemblyVersion>2.0.0.0</AssemblyVersion>
105       </AssemblyInfo>
106       <Parameters />
107       <Docs>
108         <remarks>To be added.</remarks>
109         <summary>
110           <attribution license="cc4" from="Microsoft" modified="false" />
111           <para>Initializes a new instance of the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> class.</para>
112         </summary>
113       </Docs>
114     </Member>
115     <Member MemberName=".ctor">
116       <MemberSignature Language="C#" Value="public OdbcConnectionStringBuilder (string connectionString);" />
117       <MemberType>Constructor</MemberType>
118       <AssemblyInfo>
119         <AssemblyVersion>2.0.0.0</AssemblyVersion>
120       </AssemblyInfo>
121       <Parameters>
122         <Parameter Name="connectionString" Type="System.String" />
123       </Parameters>
124       <Docs>
125         <remarks>
126           <attribution license="cc4" from="Microsoft" modified="false" />
127           <para>You can pass a connection string in the constructor, or you can set the <see cref="P:System.Data.Common.DbConnectionStringBuilder.ConnectionString" /> property explicitly. The behavior is the same either way.</para>
128         </remarks>
129         <summary>
130           <attribution license="cc4" from="Microsoft" modified="false" />
131           <para>Initializes a new instance of the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> class. The provided connection string provides the data for the instance's internal connection information.</para>
132         </summary>
133         <param name="connectionString">
134           <attribution license="cc4" from="Microsoft" modified="false" />The basis for the object's internal connection information. Parsed into key/value pairs.</param>
135       </Docs>
136     </Member>
137     <Member MemberName="Clear">
138       <MemberSignature Language="C#" Value="public override void Clear ();" />
139       <MemberType>Method</MemberType>
140       <AssemblyInfo>
141         <AssemblyVersion>2.0.0.0</AssemblyVersion>
142       </AssemblyInfo>
143       <ReturnValue>
144         <ReturnType>System.Void</ReturnType>
145       </ReturnValue>
146       <Parameters />
147       <Docs>
148         <remarks>
149           <attribution license="cc4" from="Microsoft" modified="false" />
150           <para>The <see cref="M:System.Data.Odbc.OdbcConnectionStringBuilder.Clear" /> method removes all key/value pairs from the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> and resets the <see cref="P:System.Data.Odbc.OdbcConnectionStringBuilder.Driver" /> and <see cref="P:System.Data.Odbc.OdbcConnectionStringBuilder.Dsn" /> properties to their default values. The <see cref="M:System.Data.Odbc.OdbcConnectionStringBuilder.Clear" /> method also sets the <see cref="P:System.Data.Common.DbConnectionStringBuilder.Count" /> property to 0 and the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder.ConnectionString" /> property to an empty string.</para>
151         </remarks>
152         <summary>
153           <attribution license="cc4" from="Microsoft" modified="false" />
154           <para>Clears the contents of the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> instance.</para>
155         </summary>
156       </Docs>
157     </Member>
158     <Member MemberName="ContainsKey">
159       <MemberSignature Language="C#" Value="public override bool ContainsKey (string keyword);" />
160       <MemberType>Method</MemberType>
161       <AssemblyInfo>
162         <AssemblyVersion>2.0.0.0</AssemblyVersion>
163       </AssemblyInfo>
164       <ReturnValue>
165         <ReturnType>System.Boolean</ReturnType>
166       </ReturnValue>
167       <Parameters>
168         <Parameter Name="keyword" Type="System.String" />
169       </Parameters>
170       <Docs>
171         <remarks>To be added.</remarks>
172         <summary>
173           <attribution license="cc4" from="Microsoft" modified="false" />
174           <para>Determines whether the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> contains a specific key.</para>
175         </summary>
176         <returns>
177           <attribution license="cc4" from="Microsoft" modified="false" />
178           <para>true if the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> contains an element that has the specified key; otherwise false.</para>
179         </returns>
180         <param name="keyword">
181           <attribution license="cc4" from="Microsoft" modified="false" />The key to locate in the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" />.</param>
182       </Docs>
183     </Member>
184     <Member MemberName="Driver">
185       <MemberSignature Language="C#" Value="public string Driver { set; get; }" />
186       <MemberType>Property</MemberType>
187       <AssemblyInfo>
188         <AssemblyVersion>2.0.0.0</AssemblyVersion>
189       </AssemblyInfo>
190       <Attributes>
191         <Attribute>
192           <AttributeName>System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)</AttributeName>
193         </Attribute>
194         <Attribute>
195           <AttributeName>System.ComponentModel.DisplayName("Driver")</AttributeName>
196         </Attribute>
197       </Attributes>
198       <ReturnValue>
199         <ReturnType>System.String</ReturnType>
200       </ReturnValue>
201       <Docs>
202         <value>To be added.</value>
203         <remarks>
204           <attribution license="cc4" from="Microsoft" modified="false" />
205           <para>If the value passed in is null when you try to set the property, the <see cref="P:System.Data.Odbc.OdbcConnectionStringBuilder.Driver" /> property is reset. If the value has not been set and the developer tries to retrieve the property, the return value is String.Empty. This property corresponds to the "Driver" key within the connection string.</para>
206         </remarks>
207         <summary>
208           <attribution license="cc4" from="Microsoft" modified="false" />
209           <para>Gets or sets the name of the ODBC driver associated with the connection.</para>
210         </summary>
211       </Docs>
212     </Member>
213     <Member MemberName="Dsn">
214       <MemberSignature Language="C#" Value="public string Dsn { set; get; }" />
215       <MemberType>Property</MemberType>
216       <AssemblyInfo>
217         <AssemblyVersion>2.0.0.0</AssemblyVersion>
218       </AssemblyInfo>
219       <Attributes>
220         <Attribute>
221           <AttributeName>System.ComponentModel.RefreshProperties(System.ComponentModel.RefreshProperties.All)</AttributeName>
222         </Attribute>
223         <Attribute>
224           <AttributeName>System.ComponentModel.DisplayName("Dsn")</AttributeName>
225         </Attribute>
226       </Attributes>
227       <ReturnValue>
228         <ReturnType>System.String</ReturnType>
229       </ReturnValue>
230       <Docs>
231         <value>To be added.</value>
232         <remarks>
233           <attribution license="cc4" from="Microsoft" modified="false" />
234           <para>If the value passed in is null when you try to set the property, the <see cref="P:System.Data.Odbc.OdbcConnectionStringBuilder.Dsn" /> property is reset. If the value has not been set and the developer tries to retrieve the property, the return value is String.Empty. This property corresponds to the "Dsn" key within the connection string.</para>
235         </remarks>
236         <summary>
237           <attribution license="cc4" from="Microsoft" modified="false" />
238           <para>Gets or sets the name of the data source name (DSN) associated with the connection.</para>
239         </summary>
240       </Docs>
241     </Member>
242     <Member MemberName="Item">
243       <MemberSignature Language="C#" Value="public override object this[string keyword] { set; get; }" />
244       <MemberType>Property</MemberType>
245       <AssemblyInfo>
246         <AssemblyVersion>2.0.0.0</AssemblyVersion>
247       </AssemblyInfo>
248       <ReturnValue>
249         <ReturnType>System.Object</ReturnType>
250       </ReturnValue>
251       <Parameters>
252         <Parameter Name="keyword" Type="System.String" />
253       </Parameters>
254       <Docs>
255         <param name="keyword">To be added.</param>
256         <summary>To be added.</summary>
257         <value>To be added.</value>
258         <remarks>To be added.</remarks>
259       </Docs>
260     </Member>
261     <Member MemberName="Keys">
262       <MemberSignature Language="C#" Value="public override System.Collections.ICollection Keys { get; }" />
263       <MemberType>Property</MemberType>
264       <AssemblyInfo>
265         <AssemblyVersion>2.0.0.0</AssemblyVersion>
266       </AssemblyInfo>
267       <ReturnValue>
268         <ReturnType>System.Collections.ICollection</ReturnType>
269       </ReturnValue>
270       <Docs>
271         <value>To be added.</value>
272         <remarks>
273           <attribution license="cc4" from="Microsoft" modified="false" />
274           <para>The order of the values in the <see cref="T:System.Collections.ICollection" /> is the same order as the associated values in the <see cref="T:System.Collections.ICollection" /> returned by the <see cref="P:System.Data.Common.DbConnectionStringBuilder.Values" /> property.</para>
275         </remarks>
276         <summary>
277           <attribution license="cc4" from="Microsoft" modified="false" />
278           <para>Gets an <see cref="T:System.Collections.ICollection" /> that contains the keys in the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" />.</para>
279         </summary>
280       </Docs>
281     </Member>
282     <Member MemberName="Remove">
283       <MemberSignature Language="C#" Value="public override bool Remove (string keyword);" />
284       <MemberType>Method</MemberType>
285       <AssemblyInfo>
286         <AssemblyVersion>2.0.0.0</AssemblyVersion>
287       </AssemblyInfo>
288       <ReturnValue>
289         <ReturnType>System.Boolean</ReturnType>
290       </ReturnValue>
291       <Parameters>
292         <Parameter Name="keyword" Type="System.String" />
293       </Parameters>
294       <Docs>
295         <remarks>
296           <attribution license="cc4" from="Microsoft" modified="false" />
297           <para>Because the <see cref="M:System.Data.Odbc.OdbcConnectionStringBuilder.Remove(System.String)" /> method returns a value that indicates its success, it is not required to look for the existence of a key before trying to remove the key/value pair from the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> instance.</para>
298         </remarks>
299         <summary>
300           <attribution license="cc4" from="Microsoft" modified="false" />
301           <para>Removes the entry with the specified key from the <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" /> instance.</para>
302         </summary>
303         <returns>
304           <attribution license="cc4" from="Microsoft" modified="false" />
305           <para>true if the key existed within the connection string and was removed; false if the key did not exist.</para>
306         </returns>
307         <param name="keyword">
308           <attribution license="cc4" from="Microsoft" modified="false" />The key of the key/value pair to be removed from the connection string in this <see cref="T:System.Data.Odbc.OdbcConnectionStringBuilder" />.</param>
309       </Docs>
310     </Member>
311     <Member MemberName="TryGetValue">
312       <MemberSignature Language="C#" Value="public override bool TryGetValue (string keyword, out object value);" />
313       <MemberType>Method</MemberType>
314       <AssemblyInfo>
315         <AssemblyVersion>2.0.0.0</AssemblyVersion>
316       </AssemblyInfo>
317       <ReturnValue>
318         <ReturnType>System.Boolean</ReturnType>
319       </ReturnValue>
320       <Parameters>
321         <Parameter Name="keyword" Type="System.String" />
322         <Parameter Name="value" Type="System.Object&amp;" RefType="out" />
323       </Parameters>
324       <Docs>
325         <param name="keyword">To be added.</param>
326         <param name="value">To be added.</param>
327         <summary>To be added.</summary>
328         <returns>To be added.</returns>
329         <remarks>To be added.</remarks>
330       </Docs>
331     </Member>
332   </Members>
333 </Type>