Help with deleting a Row in a database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Newbie

    #1

    Help with deleting a Row in a database

    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.

  • Kerry Moorman

    #2
    RE: Help with deleting a Row in a database

    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


    "Newbie" wrote:
    [color=blue]
    > 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.
    >
    >[/color]

    Comment

    • Homer J Simpson

      #3
      Re: Help with deleting a Row in a database


      "Newbie" <laporte1@chart er.net> wrote in message
      news:1147977604 .736219.60050@i 39g2000cwa.goog legroups.com...
      [color=blue]
      > 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.[/color]

      Is there a unique combination of fields?


      Comment

      • Newbie

        #4
        Re: Help with deleting a Row in a database

        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.add new datacontrol.del ete 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.

        Comment

        • Homer J Simpson

          #5
          Re: Help with deleting a Row in a database


          "Newbie" <laporte1@chart er.net> wrote in message
          news:1148044481 .183966.7460@y4 3g2000cwc.googl egroups.com...
          [color=blue]
          > Kerry Moorman:
          >
          > I appreciate the reply, I had examined the data and found that
          > there is strong possibility that there could be duplicate rows.[/color]

          There is something VERY wrong with a database application where this is
          possible.




          Comment

          Working...