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

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

  • 2012年4月26日 17:32
     
      包含代碼

    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

所有回覆

  • 2012年4月26日 23:01
    版主
     
     

    are you running on WCF?

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

  • 2012年4月27日 4:20
     
     

    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

  • 2012年4月27日 5:45
    版主
     
     

    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.