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. datagrid data to access database

datagrid data to access database

Scheduled Pinned Locked Moved Visual Basic
databasexmlhelptutorialquestion
4 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.
  • M Offline
    M Offline
    mariap
    wrote on last edited by
    #1

    I need help with updating an access database table(access database is included in my project). my data comes from an xml that will periodically be updated and displayed on a DataGrid field. I manage to display the data onto datagrid and now I want to copy the displayed data into an access database table. Does anyone knows how to do that? Thanks for your help Maria

    P 1 Reply Last reply
    0
    • M mariap

      I need help with updating an access database table(access database is included in my project). my data comes from an xml that will periodically be updated and displayed on a DataGrid field. I manage to display the data onto datagrid and now I want to copy the displayed data into an access database table. Does anyone knows how to do that? Thanks for your help Maria

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      1. Iterate through the rows in your DataGrid control. 2. For each row, execute an INSERT INTO...VALUES DML query that inserts a row of data into a table in your Access database. This query could be constructed dynamically as a string or it could be a parametetized query stored in the Access database.

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      M 1 Reply Last reply
      0
      • P pmarfleet

        1. Iterate through the rows in your DataGrid control. 2. For each row, execute an INSERT INTO...VALUES DML query that inserts a row of data into a table in your Access database. This query could be constructed dynamically as a string or it could be a parametetized query stored in the Access database.

        Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

        M Offline
        M Offline
        mariap
        wrote on last edited by
        #3

        Thanks Paul, This is what I have done so far but it doesnt work: ################################################################## Dim newRows as DataRow = DatabaseDataSet.Tables("Table1").NewRow() Dim dr As DataRow For Each dr In Me.DataGrid1.Rows newRows = dr DatabaseDataSet.Tables("Table1").Rows.Add(newRows) Next ################################################################## Please help! Maria

        P 1 Reply Last reply
        0
        • M mariap

          Thanks Paul, This is what I have done so far but it doesnt work: ################################################################## Dim newRows as DataRow = DatabaseDataSet.Tables("Table1").NewRow() Dim dr As DataRow For Each dr In Me.DataGrid1.Rows newRows = dr DatabaseDataSet.Tables("Table1").Rows.Add(newRows) Next ################################################################## Please help! Maria

          P Offline
          P Offline
          pmarfleet
          wrote on last edited by
          #4

          What do you mean 'it doesn't work'? What do you expect it to do? Do you get an error? You need to be more specific. All your code appears to do is add rows to a Table in a DataSet. Where is your code to connect and add the data to your Access database? I suggested a way of doing this in my previous post.

          Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

          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