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. VB.net connect to Access with master and child table

VB.net connect to Access with master and child table

Scheduled Pinned Locked Moved Visual Basic
csharphelplearning
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.
  • D Offline
    D Offline
    dmtp
    wrote on last edited by
    #1

    Hi all, I'm a newbie at VB.net, I want connect to access via VB.net and manager two table with a relation type "master-child", Master table named "Book" consists of three columns: BookID [AutoNumber], Author [Text], Description [Text], Child table named "Chapter" with three columns: ChapterID [AutoNumber], BookID [Number], Title [Text], Then I create an application VB.net that has one main window using a dataset with two table Book and Chapter. I make a relation between them, from BookID in the table Chapter to BookID in the master table. I use a databindingsource to manager them, the table Book is displayed by a form detail, the Chapter by a datagridview. When I delete a row in Book-table, I also want delete all chapter located it. I tried to use Tableadapter but the chapters were not deleted. Help me,

    B 1 Reply Last reply
    0
    • D dmtp

      Hi all, I'm a newbie at VB.net, I want connect to access via VB.net and manager two table with a relation type "master-child", Master table named "Book" consists of three columns: BookID [AutoNumber], Author [Text], Description [Text], Child table named "Chapter" with three columns: ChapterID [AutoNumber], BookID [Number], Title [Text], Then I create an application VB.net that has one main window using a dataset with two table Book and Chapter. I make a relation between them, from BookID in the table Chapter to BookID in the master table. I use a databindingsource to manager them, the table Book is displayed by a form detail, the Chapter by a datagridview. When I delete a row in Book-table, I also want delete all chapter located it. I tried to use Tableadapter but the chapters were not deleted. Help me,

      B Offline
      B Offline
      Bernhard Hiller
      wrote on last edited by
      #2

      When you create / edit the table definitions, make sure that you set referential integrity with "OnDeleteCascade". Then the database will handle that.

      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