DataSourceOdbc class

Namespace: TECIT.TFORMer

Specialized DataSource for ODBC data.

Usage and notes

Overview

DataSourceOdbc is a specialized DataSource for importing data from an ODBC database.
This class is used to manipulate existing DataSourceOdbc objects. To create a new DataSource use TFORMer Designer or Project.AddDataSource.

The main properties to characterize a DataSourceOdbc are:

  • The DSN
    The DSN represents the name of the database connection as defined in the Microsoft Windows Control Panel. Please keep in mind that the DSN is a part of the connection string and thus a complete specification is required.

  • The user name
    It depends on the database connection if the user-name is required or not.

  • The password
    It depends on the database connection if the password is required or not.

  • The SQL SELECT statement
    The column names returned by the SQL SELECT statement should match the names of the DataFields in the FormLayout. Use SQL aliases if required.

Modifying an Existing ODBC DataSource

Sample source code for modifying an existing ODBC-DataSource:

  // Retrieve the global Project
  // DataSources are defined in a Project or a global Project
  Project project = repository.GlobalProject;

  // Retrieve the DataSource by name
  // Since we know the type of the DataSource, we can cast it to DataSourceOdbc
  DataSourceOdbc dataSource = (DataSourceOdbc) (project.GetDataSource("ODBC"));

  // Modify some DataSource properties  
  dataSource.User = "";
  dataSource.Password = "";

Base types: DataSource

Inherited members (27)

Properties

MemberDescription
Dsnstring { get; set; }

Gets/Sets the DSN of the DataSourceOdbc.

Passwordstring { get; set; }

Gets/Sets the password for the database connection.

SqlSelectstring { get; set; }

Gets/Sets the SQL SELECT statement of the DataSourceOdbc.

Userstring { get; set; }

Gets/Sets the user-name for the database connection.

Methods

MemberDescription
ToString()override · Returns: string

Returns a string representation of the instance.

Search documentation

Search in
More scopes
Additional scopes

All contents