C# 클래스 LitDev.LDDataBase

파일 보기 프로젝트 열기: litdev1/LitDev

공개 메소드들

메소드 설명
AddListView ( Primitive width, Primitive height ) : Primitive

Add a ListView to view database query results. This is a read only display of query results.

Command ( Primitive database, Primitive command ) : Primitive

Perform an SQLite, MySQL, SqlServer. OleDb or Odbc command (not a query) on a database. If this database is viewed in a dataview then unsaved user changes will be lost when the dataview is updated following this operation.

ConnectMySQL ( Primitive server, Primitive user, Primitive password, Primitive database ) : Primitive

Connect to a MySQL database. This must be called before any SQL methods. The MySQL service must be running and database with credentials already created, if in doubt use SQLite.

ConnectOdbc ( Primitive driver, Primitive server, Primitive port, Primitive user, Primitive password, Primitive option, Primitive database ) : Primitive

Connect to an Odbc driver connected database. This must be called before any SQL methods. The Odbc service must be running and database with credentials already created, if in doubt use SQLite.

ConnectOleDb ( Primitive provider, Primitive server, Primitive database ) : Primitive

Connect to an Access OleDb database. This must be called before any SQL methods. The Access OleDb service must be running and database with credentials already created, if in doubt use SQLite.

ConnectSQLite ( Primitive fileName ) : Primitive

Create or open an SQLite database. This must be called before any SQL methods. When a table is created it must have first column as "Id INTEGER PRIMARY KEY".

ConnectSqlServer ( Primitive server, Primitive database ) : Primitive

Connect to a SqlServer database. This must be called before any SQL methods. The SqlServer service must be running and database with credentials already created, if in doubt use SQLite.

EditTable ( Primitive database, Primitive table, Primitive dataview ) : Primitive

Display a database table for editing in a LDControls.DataView control. Using this method the database is bound to the dataview conrol, reflecting the database.

Query ( Primitive database, Primitive query, Primitive listview, Primitive getRecords ) : Primitive

Perform an SQLite, MySQL, SqlServer, OleDb or Odbc Query (not a command) on a database.

SaveTable ( Primitive database, Primitive dataview ) : Primitive

Commit any changes made in a LDControls.DataView to the database.

비공개 메소드들

메소드 설명
AddDataBase ( Primitive fileName ) : Primitive
AddDataView ( Primitive width, Primitive height ) : Primitive
ConnectDataBase ( Primitive server, Primitive user, Primitive password, Primitive database ) : Primitive
Data2Grid ( string shapeName, DataTable dataTable ) : void
ExtractDll ( ) : void
GetDataBase ( string name, bool bShowErrors = true ) : DataBase
GetDataTable ( DataBase dataBase, string query, DataTable dataTable ) : DataTable
NextID ( ) : int
UpdateDataTable ( DataBase dataBase, System.Windows.Forms.DataGridView dataView ) : void
UpdateDataTableBySQL ( DataBase dataBase, System.Windows.Forms.DataGridView dataView ) : void

메소드 상세

AddListView() 공개 정적인 메소드

Add a ListView to view database query results. This is a read only display of query results.
public static AddListView ( Primitive width, Primitive height ) : Primitive
width Primitive The width of the ListView.
height Primitive The height of the ListView.
리턴 Primitive

Command() 공개 정적인 메소드

Perform an SQLite, MySQL, SqlServer. OleDb or Odbc command (not a query) on a database. If this database is viewed in a dataview then unsaved user changes will be lost when the dataview is updated following this operation.
public static Command ( Primitive database, Primitive command ) : Primitive
database Primitive The existing database label (see ConnectSQLite, ConnectMySQL, ConnectSqlServer, ConnectOleDb or ConnectOdbc).
command Primitive The SQL Command.
리턴 Primitive

ConnectMySQL() 공개 정적인 메소드

Connect to a MySQL database. This must be called before any SQL methods. The MySQL service must be running and database with credentials already created, if in doubt use SQLite.
public static ConnectMySQL ( Primitive server, Primitive user, Primitive password, Primitive database ) : Primitive
server Primitive The MySQL server (e.g. "localhost").
user Primitive The MySQL user name.
password Primitive The MySQL user password.
database Primitive The MySQL database name.
리턴 Primitive

ConnectOdbc() 공개 정적인 메소드

Connect to an Odbc driver connected database. This must be called before any SQL methods. The Odbc service must be running and database with credentials already created, if in doubt use SQLite.
public static ConnectOdbc ( Primitive driver, Primitive server, Primitive port, Primitive user, Primitive password, Primitive option, Primitive database ) : Primitive
driver Primitive The Odbc driver (e.g. "{MySQL ODBC 3.51 Driver}").
server Primitive The Odbc server (e.g. "localhost").
port Primitive The Odbc port number.
user Primitive The Odbc user name.
password Primitive The Odbc user password.
option Primitive The Odbc option number to control the Odbc connection (e.g. 0 or 3).
database Primitive The Odbc database name.
리턴 Primitive

ConnectOleDb() 공개 정적인 메소드

Connect to an Access OleDb database. This must be called before any SQL methods. The Access OleDb service must be running and database with credentials already created, if in doubt use SQLite.
public static ConnectOleDb ( Primitive provider, Primitive server, Primitive database ) : Primitive
provider Primitive The OleDb provider (e.g. "SQLOLEDB").
server Primitive The OleDb server (e.g. "localhost").
database Primitive The OleDb database name.
리턴 Primitive

ConnectSQLite() 공개 정적인 메소드

Create or open an SQLite database. This must be called before any SQL methods. When a table is created it must have first column as "Id INTEGER PRIMARY KEY".
public static ConnectSQLite ( Primitive fileName ) : Primitive
fileName Primitive The full path to the SQLite database file (usually with extension db).
리턴 Primitive

ConnectSqlServer() 공개 정적인 메소드

Connect to a SqlServer database. This must be called before any SQL methods. The SqlServer service must be running and database with credentials already created, if in doubt use SQLite.
public static ConnectSqlServer ( Primitive server, Primitive database ) : Primitive
server Primitive The SqlServer server (e.g. "(local)\SQLEXPRESS").
database Primitive The SqlServer database name.
리턴 Primitive

EditTable() 공개 정적인 메소드

Display a database table for editing in a LDControls.DataView control. Using this method the database is bound to the dataview conrol, reflecting the database.
public static EditTable ( Primitive database, Primitive table, Primitive dataview ) : Primitive
database Primitive The existing database label (see ConnectSQLite, ConnectMySQL, ConnectSqlServer, ConnectOleDb or ConnectOdbc).
table Primitive The table name to view and edit.
dataview Primitive A DataView control.
리턴 Primitive

Query() 공개 정적인 메소드

Perform an SQLite, MySQL, SqlServer, OleDb or Odbc Query (not a command) on a database.
public static Query ( Primitive database, Primitive query, Primitive listview, Primitive getRecords ) : Primitive
database Primitive The existing database label (see ConnectSQLite, ConnectMySQL, ConnectSqlServer, ConnectOleDb or ConnectOdbc).
query Primitive The SQL Query. /// Example "SELECT * FROM myTable;".
listview Primitive A ListView to populate with the query result or "" for none.
getRecords Primitive Optionally return an array of results ("True" or "False"). /// Remember large multi-dimensional arrays in Small Basic are slow.
리턴 Primitive

SaveTable() 공개 정적인 메소드

Commit any changes made in a LDControls.DataView to the database.
public static SaveTable ( Primitive database, Primitive dataview ) : Primitive
database Primitive The existing database label (see ConnectSQLite, ConnectMySQL, ConnectSqlServer, ConnectOleDb or ConnectOdbc).
dataview Primitive A DataView control.
리턴 Primitive