I think Im doing it all wrong - Please Help

  • Thread starter Thread starter Newbie!
  • Start date Start date
N

Newbie!

Hi Group,

I have a project which has a access database with it. I`ve added the
Database Adapter And Database connected to each of my forms, generated a
Dataset, and added the relivant table from the Database into it.

Is this right or should i only add my Database Adapter and Connector once to
my project?

Ta
Si
 
Hi Newbie,

It depends totaly how you use it.
There is for this as for most things in VB.net not an best answer how to do.

But working with 2 totaly seperated forms is for a newbie mostly a problem.

My advice is to try it first with one and some dialogforms or use the MDI
forms

But did you see the VB.net resource kit, there are a lot of samples there.

http://msdn.microsoft.com/vbasic/vbrkit/default.aspx

And if you have problems installing it

http://msdn.microsoft.com/vbasic/vbrkit/faq/#installvdir

I hope this helps a little bit?

Cor
 
* "Newbie! said:
I have a project which has a access database with it. I`ve added the
Database Adapter And Database connected to each of my forms, generated a
Dataset, and added the relivant table from the Database into it.

Is this right or should i only add my Database Adapter and Connector once to
my project?

One connection to the same database should be enough in most scenarios.
Are you using databound controls?
 
yer have about 10 forms all looking at differnent table

whwre would i declare on database connection so that all form could share
it?

Regards
Si
 
Herfried,
One connection to the same database should be enough in most scenarios.
Are you using databound controls?

As far as I know only for datasets, the OP is talking about that, but I
thought it would be right to point your attention on that.

Cor
 
Hi Newbie,

The wizard method gives problems as you are making more and more complex
connections.

But for the first time it is ok.

There is also no problem if you make for every form a new connection.

But you will see going on, that that wizards gives you on a certain moment
more work than that it helps you.

My thought was that you did want to spread the data from one database with
one connection over two forms in the same time. Absolute posible but with
the wizard a little bit much work.

That is all,

Cor
 
* "Newbie! said:
whwre would i declare on database connection so that all form could share
it?
You can create the connection for example in a 'Sub Main':

\\\
Public Module AppMain
Public Sub Main()

' Create connection here.
Dim f As New MainForm()
f.DataBaseConnection = ...
Application.Run(f)
End Sub
End Module
///

In the project properties, select 'Sub Main' as "startup object".
 
* "Cor said:
As far as I know only for datasets, the OP is talking about that, but I
thought it would be right to point your attention on that.

I was not sure when replying if the OP is referring to the connection to
the database, but IMO that's an important point too.
 
Back
Top