'Proper' way to databind?

  • Thread starter Thread starter sparkle
  • Start date Start date
S

sparkle

Hi I'm using a variety of sources to learn to databind my db to my
forms.

Does it make any difference if I 'drag' out an sqlDataAdapter and
Dataset?

Or

Should I put it within the VB code?

The books and videos I'm watching show the 'drag' method, while the
Microsoft samples all use the binding from within their VB.

What gives?

Thanks,
Sparkle
 
Hi Sparkle,

I think a matter of taste, when you drag them, you get a special dataset
class, with that you can use the dataset nicer. But it limits you after a
while but you can only do what the wizard do, and it build much more than
you probably needs.

When you build them yourself by code you can make your own database classes
which you can make more tailored on your purposes

I do not use the wizard and as I have seen almost nobody who is regular to
this dotnet newsgroups.

You can sometimes use them to make difficult SQL strings and than cut and
paste them in your program.

In my opinion is also a usefull tool the XSD and the XML builder but for me
without to generate a dataset class.

Just my thoughts,

Cor
 
Sparkle,
As Cor stated its a matter of taste, and I'll add project requirements.

I use both depending on the size & requirements of the project.

I only drag to the form itself in the most simply of projects, instead I
will drag to a new Component (Project - Add Component) where the Component
is my DataGateway or DAL (Data Access Layer). If project requirements don't
lend themselves to a visual Data Component, then I code the data components
by hand. In both cases I normally add code manually to better encapsulate
the data components on my component.

To me the visual designers enable you to define & set properties quicker.

Hope this helps
Jay
 
Back
Top