问题遇到的现象和发生背景
做ASP.NET网站遇到的问题,只会sql语句,在网上找的linq to sql看不明白
这个问题相关的表有三个,设计如下
问题相关代码,请勿粘贴截图
/电影表
CREATE TABLE [film]([id] int not null primary key,
[director] nchar(100),
[actor] nchar(100),
[intro] nchar(400),
[imag] nchar(100),
[name] nchar(50))
/类型表
CREATE TABLE [type] ([id] int not null primary key,
[type_name] nchar(100))
/关系表
CREATE TABLE [relationship]([id] int not null primary key,
[film_id] int,
[type_id] int)
运行结果及报错内容
我的解答思路和尝试过的方法
我觉得film表应该是主表,用外连接查询,但是不知道具体代码怎么写
我想要达到的结果
在网站上实现点击分类名显示该分类对应的所有电影名