Class DatabaseSchema
- Namespace
- Dynamicweb.Data
- Assembly
- Dynamicweb.Core.dll
Provides methods for reading database layouts from connections. Can provide information on tables and their columns.
- Inheritance
-
Database
Schema
- Inherited Members
Constructors
DatabaseSchema()
Initializes a new instance of the Database
Methods
AddColumns(string, IEnumerable<ColumnInfo>)
Adds new columns to the specified table.
Parameters
tableName
stringName of the table.
columns
IEnumerable<ColumnInfo >The columns.
Returns
Remarks
Does not merge/alter existing tables
GetTableColumns(IDbConnection, string)
Gets the table columns.
Parameters
connection
IDbConnection A database connection.
tableName
stringName of the table to get columns from.
Returns
- Data
Table A DataTable with the schema table of the tableName. Column names and DbTypes.
Remarks
Closes and disposes the connection.
GetTables()
Gets the tables in the database on the passed connection.
Returns
- Data
Table A DataTable with the schema table of the connection. Contains table names.
Remarks
Closes and disposes the connection.
GetTables(IDbConnection)
Gets the tables in the database on the passed connection.
Parameters
connection
IDbConnection A database connection of Sql
Connection . Can be obtained using CreateConnection() .
Returns
- Data
Table A DataTable with the schema table of the connection. Contains table names.
Remarks
Closes and disposes the connection.
GetTables(SqlConnection)
Gets the tables in the database on the passed connection.
Parameters
connection
SqlConnection A database connection.
Returns
- Data
Table A DataTable with the schema table of the connection. Contains table names.
Remarks
Closes and disposes the connection.