copying large tables
-
hi dudes, i want to copy a table from an access database to another table on another access database in windows application using c#,what is the best solution,i dont want my application to hang while copying the data;i've tried reading record by record by a simple oledbcommand execute way,but it would take a long time,i have a lot of records in source database,how can i do the copy by using dataset?is using dataset the best solution? how? how can i relate a progress bar to that? i've seen a class named sqlbulk which works for sql databases that copies a large amount of data between tables or databases,but my database is access.i will be thankful for those who do me a favor and give me an answer.
-
hi dudes, i want to copy a table from an access database to another table on another access database in windows application using c#,what is the best solution,i dont want my application to hang while copying the data;i've tried reading record by record by a simple oledbcommand execute way,but it would take a long time,i have a lot of records in source database,how can i do the copy by using dataset?is using dataset the best solution? how? how can i relate a progress bar to that? i've seen a class named sqlbulk which works for sql databases that copies a large amount of data between tables or databases,but my database is access.i will be thankful for those who do me a favor and give me an answer.
Don't use DataSet. Work with a reader and iterate all the rows and insert into target database. Do this in a separate thread, so that your application won't hang.
Best wishes, Navaneeth
-
Don't use DataSet. Work with a reader and iterate all the rows and insert into target database. Do this in a separate thread, so that your application won't hang.
Best wishes, Navaneeth
Just to add to this, use a progress bar as well, so that the user can tell the app is still working. (Always use a progress bar if the app is going to do anything that takes over two seconds is a good general rule). Nothing will speed the process up noticably, particularly if the two databases are on separate machines.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
-
Just to add to this, use a progress bar as well, so that the user can tell the app is still working. (Always use a progress bar if the app is going to do anything that takes over two seconds is a good general rule). Nothing will speed the process up noticably, particularly if the two databases are on separate machines.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
thank u both of my friends for ur answer,both of the answered gave me a pointer,but how can i relate copying data to a progress bar?