Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delayed DataLoad

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
flc.net



Joined: 21 Jun 2005
Posts: 89
Location: Switzerland

PostPosted: Tue Apr 25, 2006 4:16 pm    Post subject: Delayed DataLoad Reply with quote

Dear Support

in our project we do have over a 50'000 rows. As the stored procedure is too slow for such a lot of data we want to load data delayed into the dataset. I tried to solve this with VirtualTree but didn't succeed. Can you please complete my sample app?

Thanks a lot
Giuseppe
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Apr 26, 2006 9:24 am    Post subject: Reply with quote

ADO.NET is not really designed to handle this sort of scenario. ADO.NET is designed as disconnected database model. For a database with 50000+ rows you are probably going to be loading 20Mb+ of data alone into memory. This will not only be slow but is a waste of memory.

If you don't need the disconnected model (ie your product isn't a web service and doesn't have 1000's of users) then you should consider using our Virtual Data Objects (VDO) product. This allows to display millions of rows with virtually no memory overhead because it uses a server side cursor to get data, as it is required, into memory. VDO is also (in our opinion) much easier to use than ADO.NET when it comes to saving changes into the database.

Check out the Virtual Tree Database Browser sample - it uses VDO to browse a large database.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
flc.net



Joined: 21 Jun 2005
Posts: 89
Location: Switzerland

PostPosted: Wed Apr 26, 2006 9:59 am    Post subject: Reply with quote

Infralution wrote:
ADO.NET is not really designed to handle this sort of scenario. ADO.NET is designed as disconnected database model. For a database with 50000+ rows you are probably going to be loading 20Mb+ of data alone into memory. This will not only be slow but is a waste of memory.


I'm sorry, probably i wasn't so clear.
I have 3 levels

Level 1 : 20 Rows
Level 2: 100 Rows (for each Level 1)
Level 3: 25 Rows (for each Level 2)

If I load everything into the DataSet i have a total of 50k Level 3 Rows.
My Idea was to get just all the Level 1 Rows
After Expand one Level 1 Row in VT, get the 100 Level 2 Rows and so on...

I tried to do something, in the GetChildren Event of VT.. but i have no idea how to do it.

Thanks
Giuseppe
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Apr 27, 2006 1:24 am    Post subject: Reply with quote

Yes you can load parts of your dataset on demand by handling the GetChildren event. The following is for your sample project:

Code:

private void virtualTree1_GetChildren(object sender, Infralution.Controls.VirtualTree.GetChildrenEventArgs e)
{
    DataRowView drv  = e.Row.Item as DataRowView;
    if (drv != null)
    {
        MyDataSet.CompanyRow cr = drv.Row as MyDataSet.CompanyRow;
        if (cr != null)
        {
            if (cr.GetPersonRows().Length == 0)
            {
                for (int i = 0; i < 20; i++)
                {
                    myDataSet1.Person.AddPersonRow(cr.CompanyName + i.ToString(), cr);
                }
            }
        }
    }
    RowBinding rowBinding = virtualTree1.GetRowBinding(e.Row);
    e.Children = rowBinding.GetChildrenForRow(e.Row);
}


In real code where the data comes from a database you would use a data adapter to fill (add) the person rows. The last two lines call the default rowBinding method for getting the children.

You should also consider setting the ChildPolicy for the Company row to LoadOnExpand so that you don't end up loading the data as the user scrolls through the list.

We'll email you back the modified sample project.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
flc.net



Joined: 21 Jun 2005
Posts: 89
Location: Switzerland

PostPosted: Thu Apr 27, 2006 6:52 am    Post subject: Reply with quote

great. thanks a lot.
giuseppe
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Apr 27, 2006 7:10 am    Post subject: Reply with quote

It still would be worthwhile taking a look at Virtual Data Objects. It really is much easy to use than ADO.NET when you are in a connected environment (eg desktop applications) and is much faster and more memory efficient as well.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group