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. Master-detail table access vb.net

Master-detail table access vb.net

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharphelplearning
3 Posts 3 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,

    L Z 2 Replies 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,

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Its quite tricky, but try to post this question at likeplum. I always get good answers there to my computer/programming issues and questions. They have programmers online to help you now. You can get a great answer to your question so fast. https://www.likeplum.com/help/programming?aid=3321 :)

      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,

        Z Offline
        Z Offline
        ZurdoDev
        wrote on last edited by
        #3

        I would recommend setting up your foreign keys in SQL properly so that it cascade deletes. Please refer to the following URL for an example: http://blog.sqlauthority.com/2012/08/17/sql-server-curious-case-of-disappearing-rows-on-update-cascade-and-on-delete-cascade-t-sql-example-part-2-of-2/[^] This way, when you delete a Book SQL will delete the chapters for you. You won't have to write extra code to make sure your records aren't orphaned.

        There are only 10 types of people in the world, those who understand binary and those who don't.

        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