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

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

Public Methods

Method 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

Method 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 method

Close the OleDb connection
public Dispose ( ) : void
return void

ExecuteCommnand() public method

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

GenDataTable() public method

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
return System.Data.DataTable

RetrieveAllTables() public method

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

XlsDBConnector() public method

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.
return System