Best practice for windows form and database access.

  • Thread starter Thread starter AMeador
  • Start date Start date
A

AMeador

I am doing a project where we need to read a write data to a
database (SQL Server 2K in this case). I have seen the use of data
binding to link a property of a control to a field in a record set from
a database. It seems like this can give some benefit like being able to
easily ignore all changes and not change the current data, to push and
pull data from the database, etc... However, I'm wandering if this is
the best way to really do professional apps. It seems like this method
forces some pretty generic navigation between records. I'm concerned
about the methods of testing validity of data - especially between
multiple fields. I have not developed database applications in .NET and
barely any in VB6. My primary usage for storing and retrieving data was
from when I used to program a lot in BASIC, PASCAL, C, and so forth
where I was doing direct file access and effectively managed my own
database system per application I wrote. I had complete control over
when, how, where, and whether to store the data. I guess I'm trying to
figure out if a hybrid between these two methods is the more
appropriate - professional way, or if binding the controls to data sets
is really the best way now. Any advice is welcome - the more the
better.
Thanks in advance!
 
Hi,
I am doing a project where we need to read a write data to a
database (SQL Server 2K in this case). I have seen the use of data
binding to link a property of a control to a field in a record set
from a database. It seems like this can give some benefit like being
able to easily ignore all changes and not change the current data, to
push and pull data from the database, etc... However, I'm wandering
if this is the best way to really do professional apps.

IMHO: Definitely NO!

It seems like
this method forces some pretty generic navigation between records.
I'm concerned about the methods of testing validity of data -
especially between multiple fields. I have not developed database
applications in .NET and barely any in VB6. My primary usage for
storing and retrieving data was from when I used to program a lot in
BASIC, PASCAL, C, and so forth where I was doing direct file access
and effectively managed my own database system per application I
wrote. I had complete control over when, how, where, and whether to
store the data. I guess I'm trying to figure out if a hybrid between
these two methods is the more appropriate - professional way, or if
binding the controls to data sets is really the best way now. Any
advice is welcome - the more the better.

Databinding seems to be a nice feature. However, if you want to write a big
application, you usually divide it in Layers (like Datalayer, Presentation
Layer, Business Layer), which is the best way to build a scalable App (just
my opinion). With DataBinding however you "jump" over the Business Layer,
which means you bind your Presentation directly to the Database. This will
lead you to problems ... In my humble opinion, DataBinding in most cases
should not be used ...

Regards,

Frank Eller
www.frankeller.de
 
Back
Top