![]() |
Public Member Functions | |
string | CopyTable (string Source, string Destination, string Table) |
Copying SQL server tables between data base More... | |
string | TableSchema (string Table, string Source) |
Private Attributes | |
string | Status = "" |
string | tableSchema = "" |
string DataBaseTransfer.SQL_Server_DataBase_Manager.CopyTable | ( | string | Source, |
string | Destination, | ||
string | Table | ||
) |
Copying SQL server tables between data base
<method="CopyTable"></method>
Source | |
Destination | |
Table |
Creating a connection to the source ///
Creating a connection to the destination ///
SQL command for the source table ///
Create a data table for the source data ///
Opening source connection ///
Begin transaction ///
Add the rows in the source data table from the source table ///
Copies the structure and data from the source data table to the destination data table ///
inserting the data into each rows of the source data table ///
Gets the current row state with relation to the DataRow ///
SQL command for the destination table ///
Building the destination command to execute ///
Opening Destination connection ///
Updating the value in the destination database by executing a update statement ///
Displays the transaction error ///
Rollback transaction ///
Committing transaction ///
Close source connection ///
Close destination connection
string DataBaseTransfer.SQL_Server_DataBase_Manager.TableSchema | ( | string | Table, |
string | Source | ||
) |
<method="TableSchema"></method>
Table | |
Source |
Creating a connection to the source ///
Open source connection ///
SQL command to execute ///
Reading the table from the source data base including description and primary key info ///
Getting the schema of the table read ///
Cycling through the rows and column saving the schema to the tableSchema string
Saves the schema to a string to be use later if a certain condition is met ///
Closing OleDb data reader ///
Disposing the OleDb command object ///
Displays the transaction error ///
Closing Source Connection ///