DataAccess Class

D

dm1608

Hi, I'm developing a simple DataAccess class using VB.NET and C# 2005 and
currently query a SQL Database with the class which returns an ArrayList
object. Only about 50 rows or so. This works fine.

From my main form, I simply loop thru the arraylist and populate a
datagridview control and update a progress bar.

The issue I have is that this seems a bit cheesy. I mean, it only takes a
sec. to update the datagridview and the progressbar flies.

How can I load the data from the DataAccess layer and update my progress bar
from the main form? Do I use events? Can someone explain to me the best
way to handle this?

Most of my processing is done in the DataAccess layer.

Thanks.
 
T

tdavisjr

If I were you I would use a generic list instead of your ArrayList.
You don't have to; but it good to leverage all the features you can
from the .NET Framework.
 
E

Eric

The DataGridView appears to have a RowsAdded event you could probably use to
update the progress bar.
 
D

dm1608

Thanks -- this is good to know. However, I think I would have to load the
data for the DGV within my DataAccess, which kind of violates my rule of not
accessing user-interface stuff from DA??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top