When(why) use DataSet?



I have a very simple Access database which consists of only one table and an
auto number field (ID) has been used as the primary key for the records. All
the columns are directly mapped to a object's properties except the ID
property of the object is set to 0 initially.

I only use OleDbCommand object to execute sql statement but is there any way
to get the value of the ID column of a just inserted row (I want to update
the ID property of the object after it's been added to the database)? I know
there's a RowUpdated event that I can use to get the data when DataAdapter
and DataSet are used but they are seems to me overkills the performence of
the application since I need to fill all records of the db into the dataSet.
So this is my newbie question about ADO .NET DataSet class: Why do we really
need this class to storing data into memory especially when there is a lot of
"data" in the database? And also how could I solve my problem of getting the
value of the ID column (Is only using a autonumber field as the primary key a
bad choice of database design?). Thanks in Advance!

regards,

Zhenyu Lu

.



Relevant Pages

  • Re: problem using identity column as primary key
    ... >> I am thinking of creating an identity column to use it as primary key ... More and more programmers who have absolutely no database training are ... the gap in the sequence is not filled in and the sequence ... vin CHARNOT NULL REFERENCES Motorpool); ...
    (microsoft.public.sqlserver.programming)
  • Re: Updating the SQL key value
    ... before creating the database, by the time I've come to pick a primary key, ... articles, each of which must be issued under a particular licence (e.g. ... GPL GNU General Public Licence http://www.gnu ... ...
    (comp.lang.php)
  • Re: Concatenate and Null Values -- Features
    ... Tony Toews dislikes cascade deletes as well as cascade updates, ... fence regarding the use of natural versus surrogate (autonumber) keys. ... Database Normalization Tips ... For optimal database design and performance, the primary key of a table ...
    (microsoft.public.access.reports)
  • Re: simple database
    ... Into what component of the database did you enter over 100 ... The company's Employee ... ID number can be a primary key in that table, ... Possessors, and Transfers are the names he is using. ...
    (microsoft.public.access.gettingstarted)
  • Re: AutoNumber Question
    ... I would like to point out that a primary key does not need to be meaningless ... database, as it would be if it was part of relationships. ... VIN is being reused. ... so a VIN has meaning separate from ...
    (microsoft.public.access.tablesdbdesign)