1 Replies - 394 Views - Last Post: 31 December 2012 - 06:55 AM Rate Topic: -----

#1 ravva  Icon User is offline

  • New D.I.C Head

Reputation: -1
  • View blog
  • Posts: 20
  • Joined: 28-November 12

copy 2 database contains to one database

Posted 30 December 2012 - 11:41 PM

File.Copy("file-a.txt", "file-b.txt", true);
File.Copy(@"" + Application.StartupPath + "\\ms.mdb" , @"" + Application.StartupPath + "\\data\\temporary.mdb",true);
im using this for copy one database content to tempory database, but i have another database name "td2012.mdb" that want to copy to tempory.mdb (after copying ms.mdb tables and td2012 tables need to contain in temp.mdb)
please help to to it,thank you......

Is This A Good Question/Topic? 0
  • +

Replies To: copy 2 database contains to one database

#2 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3652
  • View blog
  • Posts: 11,421
  • Joined: 05-May 12

Re: copy 2 database contains to one database

Posted 31 December 2012 - 06:55 AM

What's wrong with:
open destination database
open source database
foreach table in source database to be copied
{
    clone schema of table into destination
    clone indexes of table into destination
    clone permissions of table into destination

    foreach row in table
    {
        copy row into destination table
    }
}


This post has been edited by Skydiver: 31 December 2012 - 07:09 AM
Reason for edit:: Added need to clone indexes and permissions

Was This Post Helpful? 1
  • +
  • -

Page 1 of 1