I have 3 Tables:
我有3个表:
-
Titles:
- TitleId (int 6, primary key)
- TitleName (varchar 50)
TitleId(int 6,主键)
TitleName(varchar 50)
-
Authors:
- AuthorId (int 6, primary key)
- AuthorName (varchar 50)
AuthorId(int 6,主键)
作者姓名(varchar 50)
-
AuthorsTitles (this is a junction table for Titles and Authors)
AuthorsTitles(这是标题和作者的联结表)
- TitleId (int 6)
- AuthorId (int 6)
TitleId(int 6)
AuthorId(int 6)
标题:TitleId(int 6,主键)TitleName(varchar 50)
作者:AuthorId(int 6,主键)AuthorName(varchar 50)
There's a "many to many" relation: A Title may have many Authors, and an Author may have many Titles. This is why I need the junction table.
存在“多对多”关系:标题可能有许多作者,作者可能有许多标题。这就是我需要连接表的原因。
All I want is to get a Windows form with a ComboBox with Titles. The user selects a Title, and the Author or Authors of the selected Title will be listed in a ListBox.
我想要的是获得带有标题的ComboBox的Windows表单。用户选择标题,并且所选标题的作者或作者将列在ListBox中。
I'm using Microsoft Visual C# Express Edition 2008 and SQL Server Express Edition 2008.
我正在使用Microsoft Visual C#Express Edition 2008和SQL Server Express Edition 2008。
2 个解决方案
#1
I don't have sample code but hope this link helps you.
我没有示例代码,但希望此链接可以帮助您。
Data Binding in .NET / C# Windows Forms
.NET / C#Windows窗体中的数据绑定
#2
#1
I don't have sample code but hope this link helps you.
我没有示例代码,但希望此链接可以帮助您。
Data Binding in .NET / C# Windows Forms
.NET / C#Windows窗体中的数据绑定