You can use the DataForm wizard, or you can write it yourself. Typically,
you can do this in about 9 lines in many instances.(Excluding error handlers
and variable declarations) Declare a dataadapter, command, and connection.
You'll need to the dataadapter to have module level scope. Set the command
text and the connect string. Then use DataAdapter.Fill(someDataSet,
"TableName"). Oh yes, declare a commandbuiulder and associate it with the
dataadapter.
Then, set the DataGrid's datasource to the Datatable, and that's about it.
All you need to do from there is fire updates whenever the user navigates or
the form closes or whatever else event you want.
This is the simplest implementation and may not fit more complex scenarios.
You'll probably want to read Bill Vaughn's article on weaning developers
from CommandBuilders. You can't use stored procs for instance with a CB and
you can't change the concurrency options. But for simple data entry, this
will do it for you.
You can also use a Typed Dataset to improve performance, and use the
DataAdapter Configuration wizard to come up with a different solution that
gives you mroe control. Or you can roll your own logic.
Anyway,
HTH,
Bill
Then,