ADO 2.0

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I added my database (Access) to the data sources window.
Now I can drag tables and views on any form I want, which automatically
creates data-bound controls, tabeladapters and so on.
When I use the same table (as a datatable) on more then 1 form I need to
drag the same table again, which again creates Tableadapters, and so on. the
tableadapter needs to fill again, and so on. I though the data sources window
offered a central approach but seperate objects are generated.
I have written the databindings in code and created a datatable which is
created from the bindingsource on the main form. Now I don't have the ability
to drag and drop and I need to bind all the controls in code. Isn't there a
more simple approach?

Many thanks in advance for your answer.
 
Dirk,

In my idea are you asking three questions in one.

To answer the first two
To drag to, it is not needed that you drag to a form, you can as well drag
to a component and use that as many times you want on one form.

The last one
In 2.0 the dataaccess is integrated in your dataset. Add from your solution
explorer a dataset and than you will see it at the bottom of that pictogram
that you see.

I hope this helps,

Cor
 
Dirk: You can just create a Shared property (or module in VB.NET) or a
static property in C# and then reference it from there. Yes, you lose some
designer support, but in most real commercial applications, you aren't going
to be hitting the db directly anyway, you'll remote the dataset or business
object over and reference it accordingly. What you can do though is create
the component, and then just set it to the populated dataset.
 
Back
Top