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. Database & SysAdmin
  3. Database
  4. update data from datagrid using ado in vb.net

update data from datagrid using ado in vb.net

Scheduled Pinned Locked Moved Database
csharphelpannouncement
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.
  • B Offline
    B Offline
    bhaskar varma
    wrote on last edited by
    #1

    i am using vb.net with sql2000 ihave used adodb.connection and adodb.recordset then i have used a dataadapter and dataset to show resords in datagrid now i want to update changes made to the data in the datagrid can any one help me

    bhaskar varma

    W 1 Reply Last reply
    0
    • B bhaskar varma

      i am using vb.net with sql2000 ihave used adodb.connection and adodb.recordset then i have used a dataadapter and dataset to show resords in datagrid now i want to update changes made to the data in the datagrid can any one help me

      bhaskar varma

      W Offline
      W Offline
      Walter_H
      wrote on last edited by
      #2

      can be easily found in the MSDN! everything can be done by using the DataAdapter. example from MSDN: ' Assumes connection is a valid SqlConnection. Dim adapter As SqlDataAdapter = New SqlDataAdapter( _ "SELECT CategoryID, CategoryName FROM Categories", connection) adapter.UpdateCommand = New SqlCommand( _ "UPDATE Categories SET CategoryName = @CategoryName " & _ "WHERE CategoryID = @CategoryID", connection) adapter.UpdateCommand.Parameters.Add( _ "@CategoryName", SqlDbType.NVarChar, 15, "CategoryName") Dim parameter As SqlParameter = adapter.UpdateCommand.Parameters.Add( _ "@CategoryID", SqlDbType.Int) parameter.SourceColumn = "CategoryID" parameter.SourceVersion = DataRowVersion.Original Dim dataSet As DataSet = New DataSet adapter.Fill(dataSet, "Categories") Dim row As DataRow = dataSet.Tables("Categories").Rows(0) row("CategoryName") = "New Category" adapter.Update(dataSet, "Categories") -walter

      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