C# Class Revit.SDK.Samples.RoomSchedule.XlsDBConnector

An integrated class to connect .xls data source, retrieve / update data
Inheritance: IDisposable
Afficher le fichier Open project: AMEE/revit Class Usage Examples

Méthodes publiques

Méthode Description
Dispose ( ) : void

Close the OleDb connection

ExecuteCommnand ( String strCmd ) : int

Execute SQL command, such as: update and insert

GenDataTable ( String tableName ) : DataTable

Generate a DataTable data from xls data source, by a specified table name

RetrieveAllTables ( ) : List

Get all available table names from .xls data source

XlsDBConnector ( String strXlsFile ) : System

Class constructor, to retrieve data from .xls data source

Private Methods

Méthode Description
CheckSameColName ( String baseName, String compName ) : bool

Check if two columns names are the same

ValidateFile ( String strFile ) : bool

This method will validate and update attributes the specified file. The file should exist and it should have writable attribute. If it's readonly, this method will try to set the attribute to writable.

Method Details

Dispose() public méthode

Close the OleDb connection
public Dispose ( ) : void
Résultat void

ExecuteCommnand() public méthode

Execute SQL command, such as: update and insert
public ExecuteCommnand ( String strCmd ) : int
strCmd String command to be executed
Résultat int

GenDataTable() public méthode

Generate a DataTable data from xls data source, by a specified table name
public GenDataTable ( String tableName ) : DataTable
tableName String Table name to be retrieved
Résultat System.Data.DataTable

RetrieveAllTables() public méthode

Get all available table names from .xls data source
public RetrieveAllTables ( ) : List
Résultat List

XlsDBConnector() public méthode

Class constructor, to retrieve data from .xls data source
public XlsDBConnector ( String strXlsFile ) : System
strXlsFile String The .xls file to be connected. /// This file should exist and it can be writable.
Résultat System