Help with deleting a Row in a database

N

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.
 
G

Guest

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
 
H

Homer J Simpson

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?
 
N

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.
 
H

Homer J Simpson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top