Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
235
Out of memory exception with UltraWindataSource Collection
posted

Hi,

We are binding a UltraWinGrid with a UltraWindataSource. Sometime when we we frequently load lot of data into the grid using the UltraWindataSource datasource. we are getting the Out of Memory excpetion.

Below is the code we are using

 

grdOrders.DataSource = Me.GetDataSource()

Me.grdOrders.DataBind()

Private Function GetDataSource() As UltraDataSource

Dim dataSource As New UltraDataSource()

Try

dataSource.Rows.Clear()

For Each clmn In grdOrders.DisplayLayout.Bands(0).Columns

If (clmn.Style = ColumnStyle.Date Or _

clmn.Style = ColumnStyle.Time

Or _

clmn.Style = ColumnStyle.DateTime)

Then

dataSource.Band.Columns.Add(clmn.Key,

GetType(DateTime))

ElseIf (clmn.Style = ColumnStyle.Double) Then

dataSource.Band.Columns.Add(clmn.Key,

GetType(Double))

Else

dataSource.Band.Columns.Add(clmn.Key)

End If

Next

For Each tripStop In _ordersCollection

tripStop.GUICreatedFrom = GUIOrderCreatedType.Unallocated

Dim arrData As New ArrayList()

Dim orderLocation = Me.GetImportLocationDataForDO(tripStop.DeliveryOrderData.LocationId)

arrData.Add(tripStop.DeliveryOrderData.DeliveryPointdata.ExamGroupGeneralDTO.ProductType)

arrData.Add(tripStop.DeliveryOrderData.OriginatedID.ToString())

arrData.Add(tripStop.DeliveryOrderData.DeliveryPointdata.ExamGroupGeneralDTO.Installations(0).InstallationGeneral.DpVesselID)

arrData.Add(tripStop.DeliveryOrderData.DeliveryPointdata.ExamGroupGeneralDTO.Installations(0).InstallationGeneral.Description)

arrData.Add(tripStop.EarliestArrival)

arrData.Add(tripStop.EarliestArrival)

arrData.Add(tripStop.LatestArrival)

arrData.Add(tripStop.LatestArrival)

arrData.Add( _

If(tripStop.DeliveryOrderData.DeliveryVolumeType _

= BLAC.Common.ApplicationConstants.SystemConstants.INSTALLATION_DELIVERYVOLUMETYPE_FILL_TANK,

True, False))

arrData.Add( _

If(tripStop.DeliveryOrderData.DeliveryVolumeType _

= BLAC.Common.ApplicationConstants.SystemConstants.INSTALLATION_DELIVERYVOLUMETYPE_ATLEAST,

True, False))

arrData.Add( _

If(tripStop.DeliveryOrderData.DeliveryVolumeType _

= BLAC.Common.ApplicationConstants.SystemConstants.INSTALLATION_DELIVERYVOLUMETYPE_FIXED,

True, False))

arrData.Add(

If(tripStop.DeliveryOrderData.DeliveryOrderLineData.Count <= 0, 0, tripStop.TotQtyPTEstimated))

arrData.Add(tripStop.DeliveryOrderData.DocNo)

arrData.Add(

If(orderLocation IsNot Nothing, orderLocation.LocationName, String.Empty))

arrData.Add(tripStop.DeliveryOrderData.DeliveryPointdata.ExamGroupGeneralDTO.DPID)

arrData.Add(UIManager.GetGradeCode(tripStop.DeliveryOrderData.DeliveryPointdata.ExamGroupGeneralDTO.GradeID))

dataSource.Rows.Add(arrData.ToArray())

dataSource.Rows(dataSource.Rows.Count - 1).Tag = tripStop

Next

Catch

Throw ex

End Try

Return dataSource

End Function