ADO.NET Provider for CSV

Build 22.0.8462

Connection Properties

You can programmatically access the information about the available connection properties and those set in the connection string by querying the ConnectionProperties schema collection.

Retrieving Connection Property Information

To retrieve the ConnectionProperties schema collection, call the GetSchema method of the CSVConnection class. Access the results in the DataTable returned.

C#

DbProviderFactory provider = DbProviderFactories.GetFactory("System.Data.CData.CSV");
using(DbConnection conn = provider.CreateConnection()) {
  conn.Open();
  DataTable databaseSchema = conn.GetSchema("ConnectionProperties");
  foreach (DataRow row in databaseSchema.Rows) {
    Console.WriteLine(row["Name"]);
    Console.WriteLine(row["Type"]);
    Console.WriteLine(row["ShortDescription"]);
  }
} 

VB.NET

Dim provider = DbProviderFactories.GetFactory("System.Data.CData.CSV")
Using conn As DbConnection = provider.CreateConnection()
  conn.Open()
  Dim databaseSchema As DataTable = conn.GetSchema("ConnectionProperties")
    For Each row As DataRow In databaseSchema.Rows
    Console.WriteLine(row("Name"))
    Console.WriteLine(row("Type"))
    Console.WriteLine(row("ShortDescription"))
  Next
End Using

Columns Returned

The ConnectionProperties schema collection contains the following information:

Column NameData TypeDescription
NameSystem.StringThe name of the connection property.
ShortDescriptionSystem.StringA description of the connection property.
TypeSystem.StringThe data type.
ValuesSystem.StringThe allowed values.
DefaultSystem.StringThe default value if one is not set by the user.
CategorySystem.StringA category grouping associated connection properties.
RequiredSystem.StringWhether the property is required to connect.
ValueSystem.StringThe current value of the connection property.

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8462