API

DbNetCopy functionality can be integrated into your own web or windows applications using the fully documented API in Visual Studio.

A simple example might be the need to copy data from one database to another an the end of every day. With the DbNetCopy API you can easliy create your own custom application in minutes with just a few lines of code which you can then run on a scheduled basis.

...  
DbNetData SourceConn = new DbNetData(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\uploadedfiles\transactions.mdb;" );  
DbNetData TargetConn = new DbNetData(@"Server=DbServer;database=Sales;Trusted_Connection=true;");  
  
using (DbNetCopy DNC = new DbNetCopy(SourceConn, TargetConn))  
{  
    DNC.OnSourceRowRead += UpdateProgressBar;  
    DNC.CopyOption = CopyOptions.SchemaAndData;  
    DNC.SchemaOption = SchemaOptions.Drop;  
    DNC.DropTargetTable = true;  
    DNC.CopyDatabase();  
  
    PrintSummaryReport( DNC.SummaryDataTable() );  
}  
...