VB.net connect to Access with master and child table
-
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,
When you create / edit the table definitions, make sure that you set referential integrity with "OnDeleteCascade". Then the database will handle that.