DataBaseTransfer.SQL_Server_DataBase_Manager Class Reference

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 = ""
 

Member Function Documentation

◆ CopyTable()

string DataBaseTransfer.SQL_Server_DataBase_Manager.CopyTable ( string  Source,
string  Destination,
string  Table 
)

Copying SQL server tables between data base

<method="CopyTable"></method>

Parameters
Source
Destination
Table
Returns

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

◆ TableSchema()

string DataBaseTransfer.SQL_Server_DataBase_Manager.TableSchema ( string  Table,
string  Source 
)

<method="TableSchema"></method>

Parameters
Table
Source
Returns

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 ///


The documentation for this class was generated from the following file: