Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Update dataset

Update dataset

Scheduled Pinned Locked Moved Visual Basic
tutorialannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ravihd
    wrote on last edited by
    #1

    Hi How to filter record in dataset and update those filtered records Thanks in advance

    L 1 Reply Last reply
    0
    • R ravihd

      Hi How to filter record in dataset and update those filtered records Thanks in advance

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      '** Creat a dataview of the table in the dataset Dim tableView As DataView = New DataView(dataSet.Tables("TableName")) '** Filter the dataview to isolate the one row being updated Dim sb As New StringBuilder With sb .Length = 0 .Append("TableColumnName") .Append("= '") .Append("ValueOfData") .Append("'") tableView.RowFilter = .ToString End With sb = Nothing '** Do the update If tableView.Count > 0 Then '** Create a view of the row being updated Dim tr As DataRowView tr = tableView.Item(0) '** Update the columns being changed tr.Item("NameOfColumnBeingChanged") = "NewValue" tr = Nothing End If tableView = Nothing

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups