Quesion about ADO.NET in VB.NET

  • Thread starter Thread starter Cylix
  • Start date Start date
C

Cylix

I have a number of function to get some data in database,
What is the better design for the task?

There should be three function to get differnece data in difference
tables,
They may need to be call seperately, and so I prefer they have their
own function.

However, In my program, The startup process must run this function once
to set up the UI.
So I prefer there may be another function to get all the there
recordset to a datatable.
And finally, combine and return a dataset.

Actually, the bottle neck is on connection, and so, I would like to use
as few as possible of connection.

Thank you.
 
Cylix,

Which VB version are you using because for this the answers for version
2002/3 and 2005 can be different?

However keep in mind that with Adonet the best method is to open and close
connections as often as that is possible. (And because it is disconnected
instead of the connected ADO is that possible).

I hope this helps sofar.

Cor
 
Which VB version are you using because for this the answers for version
2002/3 and 2005 can be different?
I am using VS2003.
However keep in mind that with Adonet the best method is to open and close
connections as often as that is possible. (And because it is disconnected
instead of the connected ADO is that possible).
But the bottle neck is on database connection, so i would like to take
three tables once in the startup connection and close it then.
 
Cylix,

With version VS2003 you can add a Component to your project. That will open
a layer on which you can drag 3 times a dataadapter and than use every time
the same dataset.

That component becomes your DataLayer Class

To optimize slightly the normal behaviour you can than use that as
Connect.open
da1.Fill(ds)
da2.fill(ds)
da3.fill(ds)
conn.close

Be aware always to close the connection corresponding the open.
These newsgroups are filled in past by people who did not and got connection
problems.

I hope this helps,

Cor
 
Back
Top