Re: When(why) use DataSet?



Have you seen the KB article 'HOW TO: Retrieve the Identity Value While
Inserting Records into Access Database By Using Visual Basic .NET' at the
following URL ...
http://support.microsoft.com/default.aspx?scid=kb;en-us;815629

While this article does use a dataset and the RowUpdated event, this is just
for illustration - the technique used is not dependent on using a dataset.
There's another KB article ('INFO: Jet OLE DB Provider Version 4.0 Supports
SELECT @@Identity') that demonstrates how to use the same technique in
'classic' VB, where of course the dataset did not exist. The code in that
article may actually be easier to adapt to your needs than the VB.NET
example. Here's the URL for that second article ...
http://support.microsoft.com/kb/232144/EN-US/

--
Brendan Reynolds (MVP)


"sparks" <sparks@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:89641C46-A07A-4EC6-B901-6D677EC7A690@xxxxxxxxxxxxxxxx
>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

  • Concurrency Violation in DataSet Update ADO.NET
    ... Now I am developing Cheque Writing ... 'UPDATE DATABASE ... "TBKKTC") ... I use password to protect my Access database from ...
    (microsoft.public.dotnet.general)
  • Re: formatting columns
    ... This works for columns either to the left or right of the cell to be copied. ... >> I am preparing to set up a database in Access2002. ... >> have the time to set up the Access database so I must do ... >> my data entry into Excel. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Web Wiz Forums in New Subweb, Published with FP2003
    ... Whenever I download an Access database and prior to re-uploading I always do a compact and repair ... General rule once your forum is active, you should never download and then re-upload the ... FrontPage Resources, WebCircle, MS KB Quick Links, etc. ...
    (microsoft.public.frontpage.client)
  • Re: formatting columns
    ... >> I am preparing to set up a database in Access2002. ... He knows how to use Excel on a limited ... >> have the time to set up the Access database so I must do ... >> in the first cell, and then having to drap it down the ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Failure of Linked table in Access...
    ... SQL Server database via an ODBC DSN. ... in the Access database with various forms and reports. ... error and all subsequent queries on the PROJ table fail. ... The table is one of many tables that are linked from SQL Server ...
    (microsoft.public.access.modulesdaovba)