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. C#
  4. Inserting a Record in Access database using tableAdapter.

Inserting a Record in Access database using tableAdapter.

Scheduled Pinned Locked Moved C#
helpdatabasedesignlearning
1 Posts 1 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.
  • D Offline
    D Offline
    dsovino
    wrote on last edited by
    #1

    Hi everyone, i'm a little bit stuck. :doh: While i was amazing myself discovering the dateset design wizard (which means that me querys methods will get waaaay shorter now :laugh:), i'm not able to insert a row in the Access database. I'm using a query to load a treeview, which works just fine: private void GenerateTreeview() { treeView1.Nodes.Clear(); onAirDataSetTableAdapters.contenidoTableAdapter contAdap = new Loteria.onAirDataSetTableAdapters.contenidoTableAdapter(); DataTable tabla = contAdap.ObtenerDatos(); DataView dataViewHijos = new DataView(tabla); and so on.... } now, i want to add a node on the treeview, and store that into the database table where I have my items. I tried this on a try/catch/finally, just to make sure i'm not getting any errors. I call generateTreeview() function on finally, to reload my Treeview. try { onAirDataSetTableAdapters.contenidoTableAdapter contAdap = new Loteria.onAirDataSetTableAdapters.contenidoTableAdapter(); contAdap.InsertarCategoria(dlg.nombre, nodoPadretempID); } catch (OleDbException ode) { MessageBox.Show(ode.ToString(), "Error de Conexion con base de datos"); } catch (Exception er) { MessageBox.Show(er.ToString()); } finally { GenerateTreeview(); } Everything works ok, i get the updated Treeview while running my app, but the database doesn't get updated. I restart the app and i get the same initial treeview, and of course, no changes are being performed on the mdb... PLEASE HELP!! thanks for eveyones time :omg: kiweed

    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