Results 1 to 3 of 3

Thread: delete rows by keys

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    175

    delete rows by keys

    does anybody have an idea how can i find a row in defailt view table by key value that i have ?????

  2. #2
    Member
    Join Date
    Dec 2002
    Location
    NY, USA
    Posts
    52

    Re: delete rows by keys

    Originally posted by ronlahav
    does anybody have an idea how can i find a row in defailt view table by key value that i have ?????
    dim MyRow as DataRow()=ds.Tables("MyTable").Select("ID = 5")

    MyRow is an array of DataRows. Each row (element of the array) contains Item collection
    MessageBox.Show(MyRow(0).Item("Name")


    If you want to search by key based on several fields

    Dim vals As String() = {"Value1", "Value2"}
    Datatable1.PrimaryKey = New DataColumn() {.Columns("Column1"),
    .Columns("Column2")}
    dim dr as system.data.datarow = Datatable1.Rows.Find(vals)
    Iouri Boutchkine

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2003
    Posts
    175

    find & delete row in datatable

    thanks for helping me.
    mabe i didnt clarify my self as well...
    my question is not just how i find row in the dataset.
    i have key which type is integer and i want to find a row in dataset table and then to delete it. when i find the row in the dataset i dont knoe how to delete it from the dataset????
    pleeeeeesssssseeeee help me!!!!!!!!!!!!!!!

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