How to speed up saving data to database over the internet?
        Posted  
        
            by robert_d
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by robert_d
        
        
        
        Published on 2010-03-13T09:58:18Z
        Indexed on 
            2010/03/13
            13:05 UTC
        
        
        Read the original article
        Hit count: 258
        
I am using C#, Entity Framework and SQL Server 2008 Express.
I am connected to the database over the internet.
What is the best method to speed up saving/updating data to database?
It takes 87 seconds to save 180 records to the database.
It takes only 3.5 seconds to save the same number of records to local (on the same machine) SQL Server.
For every record that I save/update I check if record with this primary key exists in the database, 
if it doesn't exists I simply save it, 
if it exists I update it using ObjectContext.ApplyCurrentValues(entitySetName, currentEntity) method.
© Stack Overflow or respective owner