locked
{"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."} RRS feed

  • Question

  • Hi,

    I have 100000 records in my server databse table, when i try to download data to local .sdf file its raise this error

    {"Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."}

    here is my code

      LocalDataCache2SyncAgent syncAgent = new LocalDataCache2SyncAgent();
               Microsoft.Synchronization.Data.SyncStatistics syncStats = syncAgent.Synchronize();
               var localProvider = (ClientSyncProvider)syncAgent.LocalProvider;
               localProvider.ClientId = Guid.Parse("53406795-968f-4205-904d-12f7388316eb");

    How can i overcome that error

    Thursday, April 26, 2012 5:32 PM

All replies

  • are you running on WCF?

    if its SQL timing out, find InitializeCommands in the generated code and set the CommandTimeout in the Commands

    Thursday, April 26, 2012 11:01 PM
  • MY application is asp.net MVC one, I have done this way

      this.InsertCommand = new System.Data.SqlClient.SqlCommand();
                this.InsertCommand.CommandTimeout = 500000;

    But still error is comming

    lakmal

    Friday, April 27, 2012 4:20 AM
  • have you set the timeout for all commands?

    and btw, in your code above, you should be setting the ClientId before calling Synchronize(). setting it after you called Synchronize is useless as the sync has executed already.

    Friday, April 27, 2012 5:45 AM