Click here to Skip to main content
15,910,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i am using SqlBulkCopy Class to copy 4500000 records from MS access to SQL server(from client to server), the process ends successfully but the UI goes in not responding state, i have used a progress bar to show the progress of copying data, it also stops incresing...and at the end of process, suddenlly shows 100% copletion of process, and data coped successfully. what should i do to make UI and progress bar active?
Posted
Updated 25-Apr-12 19:00pm
v3

1 solution

You should create a thread and do the SqlBulkCopy in there instead of doing it in the main thread which freezes the user interface.
 
Share this answer
 
Comments
MahaKh 26-Apr-12 1:49am    
yes, i have done exactly the same thing, i have made a thread behind a button click, in this thread a function is passed, and in that function, the actual method is called which contains SqlBulkcopy.writeToserver() call.... the ode runs perfectly for 100000 records, as it goes uo to 200000 records, UI stops responding.
[no name] 26-Apr-12 6:37am    
Since you did not post any code demonstrating your problem, how are we supposed to know?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900