Print Page | Close Window

Issue saving huge data

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1905
Printed Date: 02-Jun-2025 at 12:04pm


Topic: Issue saving huge data
Posted By: bjmreddy
Subject: Issue saving huge data
Date Posted: 22-Jun-2010 at 11:12am
Hi Gurus,
I am new to Silverlight, currently I am having issue when executing below code @ _mgr.SaveChangesAsync , it works fine when there are about 500- 1000 rows, but fails if total records to save are more than 1000 only error I get is "NOT FOUND"
 
            if (!_mgr.HasChanges())
            {
                WriteMessage("No changes to save.");
                return;
            }
            WriteMessage("Saving ...");
         
            _mgr.SaveChangesAsync(
              args =>
              {
                  if (args.IsCompleted)
                  {
                      WriteMessage("Changes saved");
                  }
                  else
                  {
                      WriteMessage(args.Error.Message);
                  }
              },
              null);
 
your help in this regard is appriciated.
 
Thanks,
 



Replies:
Posted By: ting
Date Posted: 23-Jun-2010 at 6:38pm
You are likely running into a WCF/HTTP request size or timeout limit, which you can adjust in the .NET configuration files.

On the client, you should add a ServiceReferences.ClientConfig to the Silverlight project to provide configuration info, and on the server, modify the serviceModel settings in the web.config.
 
In the Learning Resources, there is a sample ClientConfig in Deployment -> Code Snippets -> Sample Files for a Silverlight App deployment.
 
In Deployment -> Code Snippets -> Sample Configuration Files for an N-Tier Deployment there are some server-side samples.  See �Server app.config.default� for an example including timeouts (unfortunately there�s no web.config sample in this folder, but the serviceModel stuff is the same).  Make sure to set both the sendTimeout and receiveTimeout on the client and the server.

There�s also another setting in system.web for large packet sizes:

<system.web>
   <!-- HTTP RUNTIME CUSTOMIZATION
         To customize the HTTP runtime, esp. when sending large amounts of data, uncomment this element
                 and set the appropriate attributes.  See http://support.softartisans.com/kbview_825.aspx - http://support.softartisans.com/kbview_825.aspx
         and http://msdn.microsoft.com/en-us/library/e1f13641.aspx - http://msdn.microsoft.com/en-us/library/e1f13641.aspx
         for more information.
    <httpRuntime maxRequestLength="102400"/>
    -->
  </system.web>

I would recommend using the WCF Service Configuration Editor (available from the Tools menu in Visual Studio) to edit the ServiceModel stuff.
 
You can also look up WCF system.serviceModel on the web for additional help.

 



Print Page | Close Window