I have a datatable out of dataset like
Dim dt as datatable = dsDB.Tables(0)
UltraDataSource.... = dt
How can I do this?
There's no quick method to do this, you would have to copy all of the data by looping through every row.
But why would you want to do this?
I am using a variant of this - I couldn't quite get the grid to look how I wanted it to, based on the original data source, so I create a temp UltraDataSource with the layout I want, and fill it during initialization. Yes, it's tedious, but fortunately in my case anyway the size of the data is fairly small.
My question is - after a bunch of manipulation to the temp datasource, and I need to store all the data back to the original - is there a simple/single "dirty" flag in the UltraDataSource that I can check to see if all that work is really necessary?
(Apologies to the OP for potentially derailing the thread...)
Rob
Well, I was looking at the Samples and saw the 'one million records' example using the UltraDataSource. Although we generally do not load that much data, in one of the applications I have written with Infragistics controls, a manager may want to have that much 'breadth' to analyze against or quickly filter through. I am able to get up to around 700,000 using datatables and standard binding and 'imagined' the WinDataSource as an athletic, low body fat version of the MS options. Upon looking a little closer now, am I to understand that it is only recommended for 'read only' grid presentation? Is the trick to its lower memory consumption just the pre-allocation of Record Count? My application allows editing but not record Adding or Deleting, couldn't it work for such an 'editable' grid?
Thanks,
Mitch
Hi Mitch,
Mitchster2 said:Upon looking a little closer now, am I to understand that it is only recommended for 'read only' grid presentation?
No, that is not correct. Where did you get that impression? I think maybe the milltion rows sample is read-only, but there are other samples that demonstrate how to allow updating, deleting, and adding. You just have to handle a few more events for those cases.
I think you have to look under the DataSource samples, not the WinGrid samples.
...\WinForms\2012.2\Samples.EN\DataSource\CS\Virtual Mode Sample - Extended
In answer to your question, I got the impression from several of your responses to other forum users, neither here nor there really.
Well, I got it all set up yesterday; created the fields manually to imitate the Datatable I had in memory.
Again, from your replies pulled up when searching on UltraDataSource, there was not an easy way to do this.
But I got it and it worked great; instantly 'standing in' perfectly for my bound datatable. Cool.
So I extended the range up toward the big one M, I needed and...
System out of memory while looping through my table to manually fill the UltraDataSource.
The actual problem is that the Datatable was pretty well 'pushing the machine's memory' and then when creating a similar object in a loop like that ... fail. I could go back to my DAL and change it to fill the UltraDataSource directly or try lazy looping through LINQ instead of using the giant Datatable. Researched that A bit and found nightmare stories as to how LINQ to SQL does not handle the memory management correctly there ... but I think I could make that work.
So before I do something like that, can you explain to me what the advantages of using the UltraDataSource are?
Thanks