DataBaseTransfer.DataBaseTransferManager Class Reference

Public Member Functions

int CopyTable (string Source, string Destination, string Table)
 Copying SQL server tables between data base More...
 
int TableSchemaCopy (string Table, string Source, string destination)
 This method creates a table schema from the source data table from the specified table of the user More...
 
int destinastionTableSchema (string Table, string destination)
 Checks for a destination table More...
 

Private Member Functions

void CreateDestinationTable (DataTable DT, string Destination, string Table)
 This Method use the source data table schema to create a table in the destination with the same properties More...
 
string Net_to_SQL (string NetType, int MaxLenght)
 This method is use to map the .Net data types to the SQL Server types. More...
 

Private Attributes

int CopytableStatus = 0
 

Member Function Documentation

◆ CopyTable()

int DataBaseTransfer.DataBaseTransferManager.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 ///

Opening source connection ///

Begin transaction ///

SQL command for the source table ///

Create a data table for the source data ///

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

Close source connection ///

Close destination connection

Rollback transaction ///

◆ CreateDestinationTable()

void DataBaseTransfer.DataBaseTransferManager.CreateDestinationTable ( DataTable  DT,
string  Destination,
string  Table 
)
private

This Method use the source data table schema to create a table in the destination with the same properties

Parameters
DT
CreateDestinationTable
Table

starting the building of the table string ///

Cycle through the column collection of the source table ///

Adding the column ///

Mapping the source column and converting to a SQL server syntax ///

Adding the identity information ///

Adding the AllowNull information ///

Adding a primary key to the table if it already exists ///

Adding the column to the primary key ///

SQL command to execute and create the table in the destination database ///

◆ destinastionTableSchema()

int DataBaseTransfer.DataBaseTransferManager.destinastionTableSchema ( string  Table,
string  destination 
)

Checks for a destination table

Parameters
Table
destination
Returns

Creating a connection to the source ///

Creating data table ///

Getting table schema ///

◆ Net_to_SQL()

string DataBaseTransfer.DataBaseTransferManager.Net_to_SQL ( string  NetType,
int  MaxLenght 
)
private

This method is use to map the .Net data types to the SQL Server types.

<method="Net_to_SQL"></method>

Parameters
NetType
MaxLenght
Returns
SQLType

◆ TableSchemaCopy()

int DataBaseTransfer.DataBaseTransferManager.TableSchemaCopy ( string  Table,
string  Source,
string  destination 
)

This method creates a table schema from the source data table from the specified table of the user

<method="TableSchema"></method>

Parameters
Table
Source
Returns
Status

Creating a connection to the source ///

Creating data table ///

Getting table schema ///

Attempt to create a table in the destination database ///


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