rakk
February 11th, 2009, 04:38 PM
Sorry for asking again but this is important for me:
I have two tables:
[publishers](
[pub_id] [char](4) NOT NULL,
[pub_name] [varchar](40) NULL,
[city] [varchar](20) NULL,
[state] [char](2) NULL,
[country] [varchar](30) )
and
[titles](
[title_id] [dbo].[tid] NOT NULL,
[title] [varchar](80) NOT NULL,
[type] [char](12) NOT NULL DEFAULT ('UNDECIDED'),
[pub_id] [char](4) NULL,
[price] [money] NULL,
[advance] [money] NULL,
[royalty] [int] NULL,
[ytd_sales] [int] NULL,
[notes] [varchar](200) NULL,
[pubdate] [datetime] NOT NULL
How can I get all the books from a certain publisher in one linq query:
The result should be something like that
Publisher 1
book1
book2
..
Publisher 2
book1
book2
..
I am a bit new to LINQ and I don't quite handle it well.
The tables above are from Nothhwind, so I am learning on them.
I have two tables:
[publishers](
[pub_id] [char](4) NOT NULL,
[pub_name] [varchar](40) NULL,
[city] [varchar](20) NULL,
[state] [char](2) NULL,
[country] [varchar](30) )
and
[titles](
[title_id] [dbo].[tid] NOT NULL,
[title] [varchar](80) NOT NULL,
[type] [char](12) NOT NULL DEFAULT ('UNDECIDED'),
[pub_id] [char](4) NULL,
[price] [money] NULL,
[advance] [money] NULL,
[royalty] [int] NULL,
[ytd_sales] [int] NULL,
[notes] [varchar](200) NULL,
[pubdate] [datetime] NOT NULL
How can I get all the books from a certain publisher in one linq query:
The result should be something like that
Publisher 1
book1
book2
..
Publisher 2
book1
book2
..
I am a bit new to LINQ and I don't quite handle it well.
The tables above are from Nothhwind, so I am learning on them.