Home All Groups Group Topic Archive Search About

Help with deleting a Row in a database

Author
18 May 2006 6:40 PM
Newbie
Can someone help:

Is there a way with ado.net and it's disconnected dataset to delete a
record in a table if you can't specify a unique field in an SQL WHERE
clause.  The current Dbase .dbf table that I'm forced to work with does
not have any fields that I can count on as being unique.  I know the
index of the row in my dataset table and I have no problem updateing
that dataset datatable, but I still need to update the database with
the delete or update etc. 


Thanks


Dave.

Author
18 May 2006 9:35 PM
Kerry Moorman
Dave,

Can you count on some combination of columns to uniquely identify a row? If
so, you can use that combination as a composite key to update or delete a
particular row.

Or are you saying that the table can have duplicate rows? In that case, I
don't know of a way to update or delete a particular row.

Kerry Moorman


Show quoteHide quote
"Newbie" wrote:

> Can someone help:
>
> Is there a way with ado.net and it's disconnected dataset to delete a
> record in a table if you can't specify a unique field in an SQL WHERE
> clause.  The current Dbase .dbf table that I'm forced to work with does
> not have any fields that I can count on as being unique.  I know the
> index of the row in my dataset table and I have no problem updateing
> that dataset datatable, but I still need to update the database with
> the delete or update etc. 
>
>
> Thanks
>
>
> Dave.
>
>
Author
19 May 2006 1:14 PM
Newbie
Kerry Moorman:

     I appreciate the reply, I had examined the data and found that
there is strong possibility that there could be duplicate rows.  That
being the case I had to call the original creator of the software and
find a field in the table that was unused.  Once I found a blank field
I have inserted a key number that I can use to keep track of the
records.
     What had me confused is a consultant had written a small little
application about 5 years ago using Visual Basic 6 and a datacontrol (
I believe it used ADO ).  Anyway that application could delete these
duplicate records by using datacontrol.addnew datacontrol.delete etc.
The only thing I could determine is that because ADO wasn't
disconnected it always new the cursor location of the record and was
able to delete rows from the table even if there were duplicates!
     The thing I wasn't sure of was if the dataset in ADO.Net had a way
to tell the database which records were updated/deleted.  I know the
dataset keeps track of edits and last changes etc, I thought there
might have been some way to send that information to the actual
database table.


Dave.
Author
19 May 2006 5:21 PM
Homer J Simpson
"Newbie" <lapor***@charter.net> wrote in message
news:1148044481.183966.7460@y43g2000cwc.googlegroups.com...

> Kerry Moorman:
>
>     I appreciate the reply, I had examined the data and found that
> there is strong possibility that there could be duplicate rows.

There is something VERY wrong with a database application where this is
possible.
Author
19 May 2006 1:23 AM
Homer J Simpson
"Newbie" <lapor***@charter.net> wrote in message
news:1147977604.736219.60050@i39g2000cwa.googlegroups.com...

> Is there a way with ado.net and it's disconnected dataset to delete a
> record in a table if you can't specify a unique field in an SQL WHERE
> clause.  The current Dbase .dbf table that I'm forced to work with does
> not have any fields that I can count on as being unique.

Is there a unique combination of fields?