Results 1 to 4 of 4

Thread: delete current record

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Location
    Pilipinas
    Posts
    441

    delete current record

    I use this code to delete the current record in my C# Project.

    dataSet11.Tables["Student"].RowDeleted;

    But it doesn't work. What code should I write?

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    RowDeleted only checks if the row was deleted (I guess).

    There must be some function like Delete or DeleteRow.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    And remember, once you delete a row in a dataset, you are only flagging it for deletion. It won't actually be deleted until you update the datasource with the dataset.

  4. #4
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Try this.
    Code:
    DataRow row = dataSet11.Tables["Student"]["myColumn"];
    row.Delete();
    This may not be the correct code (i cant test it) but it should be similar. Get a reference o the row you want to delete then call the delete function on the row object which marks the row for deletion then update the DB.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width