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