StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Asynchronous data loadingExpand / Collapse
Author
Message
Posted 10/12/2007 9:53:49 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 7:18:50 AM
Posts: 433, Visits: 1,626
Hi,
I created a BO which subclass BusinessLayer. I created FillAll() method which will load data from external source (not database). The data loading might take 30 seconds. The reason I put this code in BO is to ease data binding.

I would like to have async data loading for this. When form loaded, combobox should show "loading ..." as display value. Then program would call BO.FillAll() to query data from external source. Once complete, I want combobox to show "Please select a value" with a list of record.

How could I do this?

Thank you
Post #11955
Posted 10/12/2007 10:00:28 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 3:06:58 PM
Posts: 4,599, Visits: 4,576
We have already implemented this in the 1.6.2 update.  There is now the ability to asynchronously retrieve a BLOB (VarBinary) field which raises events notifying you of the progress of the retrieval.  This was added so that large fields (i.e. VarBinary fields storing serialized or image data) could be retrieved without a timeout on the connection while displaying a progress bar to the end-user.

This will probably not be released for 30+ days as it needs to be finalized in testing.  But this logic has already been added to the BO.

Post #11957
Posted 10/12/2007 10:15:42 AM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 7:18:50 AM
Posts: 433, Visits: 1,626
Hi,
What if my external data source is a very large XML, web service or large collection from other vendor class?

Does 1.6.2 allow me to do the same?
Post #11958
Posted 10/15/2007 9:38:44 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 09/26/2008 8:30:36 AM
Posts: 2,685, Visits: 1,886
What Trent was describing allows you to retrieve a single column from the database that is a VarBinary(MAX) (or IMAGE) field.  It doesn't do anything for what you are describing.

What you will need to do is create a method somewhere that will create a background thread to load the data.  Basically:

1) Create the method to load combo box.

2) This method starts a new thread and passes over the parameters to get to the data source and the combo box that is being populated.

3) Thread then retrieves the data and set the DataSource, DisplayMember, and ValueMember properties on the combo box (using Invoke() on the combobox to prevent CrossThreadViolationExceptions).


www.bungie.net
Post #11979
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 3:58pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.047. 10 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.