Hi there !
Why am I getting a 'System.OutOfMemoryException' error while "only" loading 201.293 rows ??
I'm binding to a custom datasource ( just a regular data class ) in-code, behind a search button ... please help !!!( I've turned off the viewstate for the Grid to try to load data faster ... doesn't make any difference ! )
What am I doing wrong ??
protected void _btnSearch_Click(object sender, EventArgs e) { if( (_tbBankanumer.Text == string.Empty) || (_tbHofudbok.Text == string.Empty) || (_tbReikningur.Text == string.Empty) ) { _lblBankanumerHofudbokReikningur.Text = "Please don't leave Bankanúmer, Höfuðbók or Reikningur empty - too much data to export to Excel!"; return; }
//1/1/1753 12:00:00 AM and 12/31/9999
DateTime dagsFra = new DateTime(1753,1,1); DateTime dagsTil = new DateTime(9999,12,31);
string bankanumer = _tbBankanumer.Text.Trim(); string hofudbok = _tbHofudbok.Text.Trim(); string reikningsnumer = _tbReikningur.Text.Trim(); if( _dateDagsetningFra.Value != null ) dagsFra = (DateTime)_dateDagsetningFra.Value; if( _dateDagsetningTil.Value != null ) dagsTil = (DateTime)_dateDagsetningTil.Value;
_transactions = TrackingService.GetAllAKTransactionTracksBySearchCriteria(bankanumer, hofudbok, reikningsnumer, dagsFra, dagsTil); Cache["dataFromGrid"] = _transactions; //I've tried taking this out to check if this matters ... doesn't change anything. I'm caching it so I can export the results to Excel later on !
if (_transactions.Count > 0) { _ugTransactions.DataSource = _transactions; // 201.293 rows _ugTransactions.DataBind(); //this will throw 'System.OutOfMemoryException' !!!!! }
_lblRows.Text = "Færslur úr leit: "; _lblRowCount.Text = _ugTransactions.Rows.Count.ToString();
Logger log = getLoggingDetails("RB Færslur", "Search for data"); TrackingService.LogIntoDatabase(log); _lblBankanumerHofudbokReikningur.Text = String.Empty; }
rgd,EE.
You don't need to set the grid's EnableViewState property to turn on the grid's AJAX. The grid will automatically disregard this property when its AJAX functioanlity is enabled.
The code you've listed should do for turning on the grid's AJAX and paging capabilities. You may need to move your databinding code into the grid's InitializeDataSource event, if its DataSource isn't set at design-time. Be sure you don't call DataBind() on the grid in this event handler - it'll be called automatically and implicitly after the event completes.
If this doesn't help - what do you mean by "with no luck"?
These are the things I'm trying ... with no luck
ugTransactions.EnableViewState =
;
_ugTransactions.DisplayLayout.LoadOnDemand = Infragistics.WebUI.UltraWebGrid.
.Xml;
_ugTransactions.Browser = Infragistics.WebUI.UltraWebGrid.
_ugTransactions.DisplayLayout.Pager.AllowPaging =
eiki666 said:Can you tell me how to enable the Grid's Ajax functionality ?
The following online help article (again from NetAdvantage for .NET 2009 Volume 1) should answer this:XML Rendering and XML Load-On-Demand
eiki666 said:Have you heard about OutOfMemory exception for only 201.293 rows ??
eiki666 said:Did you examine my code, was I doing something you wouldn't do ?
I followed this ...
http://forums.infragistics.com/forums/p/33440/182084.aspx#182084
e.g. _ugTransactions.EnableViewState = false;
LoadOnDemand.Xml;
BrowserLevel.Xml;then it pops up:"Warning: Enresponsive script"A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete"[stop script] [continue]
Is this what you're referring to ?
LoadOnDemand.Manual;
How much data is the webGrid able to databind to ?