Re: When(why) use DataSet?
- From: "Frank Hickman [MVP]" <fhickman3_NOSP@xxxxxxxxxxxxxxx>
- Date: Wed, 22 Jun 2005 22:56:19 -0400
"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
You cannot update an AutoNumber field in Access.
> 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
If you add a where clause that could not be matched, the dataset will have
the table schema and also allow for the insertion of new rows. Something
like this should work
select field1,field2,field3 from sometable where 1=0;
> value of the ID column (Is only using a autonumber field as the primary
> key a
> bad choice of database design?). Thanks in Advance!
>
Sometimes it is, usually when you know your going to be upgrading to a
server type database, like SQL Server, Oracle or one of the many others, you
would take into consideration that they all have different implemenations of
generating unique ids. An AutoNumber field is perfectly fine in Access.
> regards,
>
> Zhenyu Lu
>
--
============
Frank Hickman
Microsoft MVP
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.
.
- References:
- When(why) use DataSet?
- From: sparks
- When(why) use DataSet?
- Prev by Date: When(why) use DataSet?
- Next by Date: ADO, VB6, String data, right truncation
- Previous by thread: When(why) use DataSet?
- Next by thread: Re: When(why) use DataSet?
- Index(es):
Relevant Pages
|
|