Deleting multiple rows in a datagrid with a dataset as the datasource

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • onlyGirl
    New Member
    • Aug 2007
    • 1

    Deleting multiple rows in a datagrid with a dataset as the datasource

    How could you delete multiple rows in a datagrid?

    This is what I have so far

    [PHP]For Each row In dsPar.Tables(0) .Rows
    rowIndex = dgDelete.Curren tCell.RowNumber
    dsPar.GetChange s(DataRowState. Deleted)
    dsPar.Tables(0) .DefaultView.De lete(dgDelete.C urrentCell.RowN umber)
    command = New OleDbCommand("D elete * from Param2 Where ParamSetName = ?", gConn)
    parameter = command.Paramet ers.Add("ParamS etName", OleDbType.VarCh ar, 10, "Parameter" )
    daParm.DeleteCo mmand = command
    Next

    daParm.Update(d sPar)[/PHP]
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by onlyGirl
    How could you delete multiple rows in a datagrid? ...
    Can you explain what is happening in your code?
    Last edited by Killer42; Aug 31 '07, 08:56 AM. Reason: Shortened excessive quote block

    Comment

    • Killer42
      Recognized Expert Expert
      • Oct 2006
      • 8429

      #3
      Don't post questions in the Articles area. I've moved your thread to the proper VB forum.

      Comment

      Working...