sql - Time out retrieving items from list -


i have problem retrieving items large list. can , retrieve items small list more or less 50 items, when try retrieve items list containing more or less 4600 items, sqlsever.exe process spikes duration of request, items never retrieved. if have set web applications throttling settings, can’t causing problem. here code used retrieve items. there nothing special it.

using (spsite site = new spsite(siteurl)) {  using (spweb web = site.openweb())  {   splist list = web.lists[uid.tostring()];   splistitemcollection itemcollection = list.items;    foreach (splistitem in itemcollection) //this code stops responding   {    //use list items   }  } } 

after didn’t work, tried couple of other methods retrieve items list. here code:

splist list = web.lists[uid.tostring()];    spquery query = new spquery(); query.query = ""; query.querythrottlemode = spquerythrottleoption.override;  splistitemcollection itemcollection = list.getitems(query);  //the code stops here //i added part interest sake, wanted if looping caused problem //it seems when try access properties of item collection problem occurs int itemcount = itemcollection.count;  foreach (splistitem in itemcollection)  {  //use list items } 

i tried:

splist list = web.lists[uid.tostring()]; splistitemcollectionposition pos; datatable dt = list.getdatatable(new spquery(), splistgetdatatableoptions.none, out pos); //the code stops responding here  foreach (datarow in dt.rows) {  //use data rows  } 

does know causing problem?

thank in advance!

after long struggle found solution.

we found post:

http://trycatch.be/blogs/tom/archive/2009/04/22/never-turn-off-quot-auto-create-amp-auto-update-statistics-quot.aspx

we tested , worked!!!

so had switch "auto create statistics" , "auto update statistics" true, , problem solved

thanks replys


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -