open a connection with the database
-
Hi I am currently writting a program that read a file which contains some information. I will enter a loop that will loop 10000 or even 25000 times(depending on the number of lines)to enter these information. Now, is it a good practice to open the connection to the database and close it within the loop.So it will be opened and closed each loop.If not, what is the best solution?! I mean, will it affect the time performance?? My database is MS Access 2003 Thanks
-
Hi I am currently writting a program that read a file which contains some information. I will enter a loop that will loop 10000 or even 25000 times(depending on the number of lines)to enter these information. Now, is it a good practice to open the connection to the database and close it within the loop.So it will be opened and closed each loop.If not, what is the best solution?! I mean, will it affect the time performance?? My database is MS Access 2003 Thanks
I think it would. I'd just open the connection right before you start the loop and close it afterwards.
-
I think it would. I'd just open the connection right before you start the loop and close it afterwards.
-
Thanks I will try :) Q:Where can I find a reference that shows me when I should use the executeQueri() method and when I shold use the execute() method of the database? regards
Sorry I dont know what exactly you mean. Do you refer to the different Execute functions the IDbCommand interface has? If yes then look here.