J
John Dann
I'm in the process of learning ado.net initially to handle one
specific project. While I've got plenty of reading material to teach
me about the various ado.net classes, I'm having a little trouble
working out the best/simplest approach to updating the database and
would appreciate some guidance. Detailed constraints are as follows:
1. The database (with a single table of around 70 columns) will, for
various reasons, be an Access database and will reside on the same
single PC as will be used for viewing data and generating data
updates.
2. Data viewing and data updating will probably be best implemented as
two separate and quite independent processes. It's the updating
process where I'm struggling somewhat and this is where I'd appreciate
some advice. The new data is to be added to the database to a schedule
and is generated automatically by a PC process. It will not be exposed
to any user editing and will be validated as part of the generation
process.
3. I'd like to use native ado.net methods to implement the system -
I've never learnt ado or its predecessors and don't want to confuse my
learning of ado.net by using alternative methodology even though it
might conceivably be easier to do so.
Overall, I'm looking at the simplest way, using ado.net, of achieving
my update requirements. I can see that there are a number of options,
the problem is deciding which path to take. What I think I might want
to do is:
1. Create an empty dataset instance that maps fully, ie
field-by-field, to the complete table in my main database.
2. Populate the dataset with new data.
3. Update the database.
Step 2 is no problem. What I'm not clear about is the simplest way of
achieving step 1. Is there a single/few statement(s) I can use to do
this, ie without iterating thorugh all the fields or manually
generating a schema for the dataset (which I might have trouble
synchronising to the main database structure as the application
develops)?
TIA
JGD
specific project. While I've got plenty of reading material to teach
me about the various ado.net classes, I'm having a little trouble
working out the best/simplest approach to updating the database and
would appreciate some guidance. Detailed constraints are as follows:
1. The database (with a single table of around 70 columns) will, for
various reasons, be an Access database and will reside on the same
single PC as will be used for viewing data and generating data
updates.
2. Data viewing and data updating will probably be best implemented as
two separate and quite independent processes. It's the updating
process where I'm struggling somewhat and this is where I'd appreciate
some advice. The new data is to be added to the database to a schedule
and is generated automatically by a PC process. It will not be exposed
to any user editing and will be validated as part of the generation
process.
3. I'd like to use native ado.net methods to implement the system -
I've never learnt ado or its predecessors and don't want to confuse my
learning of ado.net by using alternative methodology even though it
might conceivably be easier to do so.
Overall, I'm looking at the simplest way, using ado.net, of achieving
my update requirements. I can see that there are a number of options,
the problem is deciding which path to take. What I think I might want
to do is:
1. Create an empty dataset instance that maps fully, ie
field-by-field, to the complete table in my main database.
2. Populate the dataset with new data.
3. Update the database.
Step 2 is no problem. What I'm not clear about is the simplest way of
achieving step 1. Is there a single/few statement(s) I can use to do
this, ie without iterating thorugh all the fields or manually
generating a schema for the dataset (which I might have trouble
synchronising to the main database structure as the application
develops)?
TIA
JGD