I have a datatable out of dataset like
Dim dt as datatable = dsDB.Tables(0)
UltraDataSource.... = dt
How can I do this?
I don't really understand what you are asking. You have a grid that's bound to a DataTable and you want to copy the data from that DataTable into an UltraDataSource to use it somewhere else? That would simply be a matter of duplicating the structure, so you would loop through the columns in the DataTable and then add a column to the UltraDataSource with the same DataType for each one. Then you would loop through the rows of the DataTable and for each one, add a row to the UltraDataSource. But you could just as easily (and probably more easily) do the same thing and copy the data into another DataTable. Either way, the data will not stay in synch, so it might be a better idea to simply use the same DataTable your original grid is bound to... depending on what you want to do.
What do you recomend to do this? I have all my Data in a DataTable and I can't change this because it is not my project and it is working in production, I just need tkae the data from the DataTable and fill my UltraDataSource to use in another thing.
Thanks.
Well, using Virtual mode may have been a solution if had been baked in at the bottom but it wasn't.
The final soultion involved doing quite a bit of testing to see what the memory usage 'shot up to' and then making a best guess estimate of how many records, how much memory we can expect our user to have ... Doing some real field testing once we had it set up. Sliding the record count down a bit when we had one or two users who still got the dreaded OOM error.
So before we load the data we run out and check the count of records that will be returned. If it is more than 600,000 then we poilitely ask the user to try and select less records.
Combining this with a new 'pre filtering' page that allows the user to limit the list to just widgets and flurps made by Ralph's or Maggie's fabrication shops allowed the users to get the really large date ranges/ and all 'departments' they wanted to see at once.
If the program were to evolve a little more we would try to blur the switching between the preload and grid pages so the user wouldn't feel like it was such a 'hump' to go back. Oh and, by the way it isn't, :) ... we are using some fairly advanced methods to get the data quickly and that ~gig of memory gets loaded in about 10 to 14 seconds.
Another thing to consider, Ramsey, is that if you are using the Export to Excel control, you can count on your memory usage doubling when it fires off.
I suspect that Infragistics could improve their architecture on this control to use the structures they already have in memory. After all the output is just XML for .xlsx files.
We never really had inconsistency errors, just the big ugly of Sys out of memory which would floorflush the app.
Another code horror story but it seemed to have a happy ending. Agile development is a lot like playing Spore or as M.Twain said about one of his books 'It just growed.'
:) Good luck
I have the same problem here. We have an app that was developed using datatables and now we have a requirement to handle 10x the number of rows. We are able to load the datatable in an acceptable amount of time but when we try to display it in the grid we get an Out of Memory exception.
I don't suppose that you have a better example of loading rows from a datatable, do you? The example that generates a cell value doesn't help much in terms of fetching a chunk of rows.
I am hoping that we could use the UltraDataSource to feed the grid and keep (with minor modification) the code we have that operates against the datatable. I am worried about tracking RowErrors, Changed rows, sorting, filtering, copy/paste.
Thanks,
Ramsey
Oh and thanks for the insightful control info. I do have that version and will come back to that... Excellent.