oldDBConnection

  • Thread starter Thread starter Rod
  • Start date Start date
R

Rod

I know my around VBA but am struggling to move over to .NET

I have an application which has several forms with DataGrids filled from
Access tables.

In addition the user may choose to jump in and out of the same form several
times.

It seems to me that I have to set up a new OleDbConnection each time the
user uses a form, this sounds inefficient.

Is it possible just to set up one which all the forms can use, or have I not
grasped the spirit of .NET?


Any guidance much appreciated

many thanks

Rod
 
Rod,

You are not the first one, however adviced is for SQLserver to open and
dispose it.

For a webform I do it always in that way. A webform is stateless so
everything should be build everytime new with every visit to the server.

What not does mean that you cannot create a class for your database handling
which you can instance everytime new. (Do not make a shared class for a
webpage).

Don't as well not forget that it is very easy to hold a dataset in a
session, what is probably a better solution in your case.

I hope this helps?

Cor
 
Rod,

Do some research into datasets. You can load multiple tables into a dataset
and you will need only to load the dataset once.

Hope this helps,
Olice
 

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

Back
Top