Forms for filling a database - advice please!

A

AMeador

I am new to writing apps that use a database in general and in .NET.
I have read about how to use SqlCommands and executing strait SQL for
inserts, selects, etc... I have also read about datasets & dataviews.
My question need here is for information on how/when to utilize these
different methods when it comes to dealing with the information that a
user enters on a windows form. Is it preferable to use a dataview and
bind the controls to the dataview and then use the dataset to move the
data to and from the SQL Server? Or, just skip the use of the dataview
and bind the dataset to the form controls and then use the dataset to
move the data to and from the SQL Server. Or track all control changes
(test property changes) and such and create SQL that is executed from
the SqlCommand? Or something else?
My goal is to have a form with text fields that the user will fill
in. There will be a few combo or list boxes that will be populated by
the app from the database and the user will select either single or
multiple entries in the lists. There will also be a tab control with
datagrids in them that the user will need to edit and add to.
Everything will be pushed back to the database and pulled from it fom
users doing a search for the record they're looking for in the first
place.
I want to give them the ability to Save, Cancel, and Undo All
Changes. Since the Dataset will keep the current and original values
for the datacolumns, I thought about binding the dataset to the
controls and utilizing its built in functions for this feature.
I think I could still do validation of the fields myself and only
tell the dataset to update the database if everything is good. So I'm
leaning towards doing it this way. However, I really don't have the
experience to know if this is a good idea or a bad idea.
I know this is a big question and probably requires and equally big
answer, but I don't know what else to do. I've read and googled and I'm
just not finding the answer. If there is anyone in the Tampa area that
would find it easir to verbally discuss it, I'd be willing. Let me know
if this is a option and I'll get you my contact information.
Thanks!
 
O

Otis Mukinfus

Below...
I am new to writing apps that use a database in general and in .NET.
I have read about how to use SqlCommands and executing strait SQL for
inserts, selects, etc... I have also read about datasets & dataviews.
My question need here is for information on how/when to utilize these
different methods when it comes to dealing with the information that a
user enters on a windows form. Is it preferable to use a dataview and
bind the controls to the dataview and then use the dataset to move the
data to and from the SQL Server? Or, just skip the use of the dataview
and bind the dataset to the form controls and then use the dataset to
move the data to and from the SQL Server. Or track all control changes
(test property changes) and such and create SQL that is executed from
the SqlCommand? Or something else?
My goal is to have a form with text fields that the user will fill
in. There will be a few combo or list boxes that will be populated by
the app from the database and the user will select either single or
multiple entries in the lists. There will also be a tab control with
datagrids in them that the user will need to edit and add to.
Everything will be pushed back to the database and pulled from it fom
users doing a search for the record they're looking for in the first
place.
I want to give them the ability to Save, Cancel, and Undo All
Changes. Since the Dataset will keep the current and original values
for the datacolumns, I thought about binding the dataset to the
controls and utilizing its built in functions for this feature.

If you want to give the user the ability to do these things, the DataSet
approach would probably fit your needs best, since no changes are made until you
tell the DataAdapter to commit the changes. A good book that describes the use
of DataSets is Sceppa's ADO.NET from MS Press.
I think I could still do validation of the fields myself and only
tell the dataset to update the database if everything is good. So I'm
leaning towards doing it this way. However, I really don't have the
experience to know if this is a good idea or a bad idea.

I personally don't see a problem with what you suggest here. If you use the
validation controls you can handle validation pretty easily.
I know this is a big question and probably requires and equally big
answer, but I don't know what else to do. I've read and googled and I'm
just not finding the answer. If there is anyone in the Tampa area that
would find it easir to verbally discuss it, I'd be willing. Let me know
if this is a option and I'll get you my contact information.
Thanks!

Otis Mukinfus
http://www.otismukinfus.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top