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. .NET (Core and Framework)
  4. Update Data into Database with DataAdapter

Update Data into Database with DataAdapter

Scheduled Pinned Locked Moved .NET (Core and Framework)
databasehelpannouncement
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.
  • N Offline
    N Offline
    Naunt
    wrote on last edited by
    #1

    Hi all, Please assist, When I try to assign a DataTable to a Table that existed in Dataset I got this error : " Property 'Item' is 'ReadOnly'." The Scenario is: After select from TableB with conditions if have got Data then Insert Into TableA.

    Dim dTable As New DataTable
    Dim ds As New DataSet
    Dim dAdp As New OdbcDataAdapter("Select Top 1 * From TableA Where 1<>1 ", ODBCcon)
    dAdp.Fill(ds, "TableA")

    sQuery = "Select * From TableB Where ...."
    dTable = SSLGetDataTable(sQuery)
    If dTable.Rows.Count > 0 Then
    ds.Tables("TableA") = dTable
    dAdp.Update(ds, "TableA")
    End If

    Thanks and Best Regards

    R 1 Reply Last reply
    0
    • N Naunt

      Hi all, Please assist, When I try to assign a DataTable to a Table that existed in Dataset I got this error : " Property 'Item' is 'ReadOnly'." The Scenario is: After select from TableB with conditions if have got Data then Insert Into TableA.

      Dim dTable As New DataTable
      Dim ds As New DataSet
      Dim dAdp As New OdbcDataAdapter("Select Top 1 * From TableA Where 1<>1 ", ODBCcon)
      dAdp.Fill(ds, "TableA")

      sQuery = "Select * From TableB Where ...."
      dTable = SSLGetDataTable(sQuery)
      If dTable.Rows.Count > 0 Then
      ds.Tables("TableA") = dTable
      dAdp.Update(ds, "TableA")
      End If

      Thanks and Best Regards

      R Offline
      R Offline
      RichardGrimmer
      wrote on last edited by
      #2

      Yep - the error message is correct.... Try .add ing the table to the DataSet

      C# has already designed away most of the tedium of C++.

      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