 |
BOOK: Beginning ASP.NET 4 : in C# and VB
 | This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

February 10th, 2014, 01:42 PM
|
|
Authorized User
|
|
Join Date: Feb 2014
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Chapter 14: Simple EntitySource Application try-it out
Ive tried to refresh the schema to show the appropriate columns in the NewPhotoAlbum details view. However I continue getting the error for unable to find CLR type for 'PlanetWroxModel.PhotoAlbum'
I redid the entity data model numerous times, and still no change, also checked to make sure the appropriate relation between PhotoAlbum and Picture tables where made.
|
|

February 10th, 2014, 05:11 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
Maybe you made a mistake in the database? Can you post an image of the relevant tables in Design Model in SQL Server Management Studio?
Imar
|
|

February 11th, 2014, 10:45 AM
|
|
Authorized User
|
|
Join Date: Feb 2014
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Diagram photo
|
|

February 11th, 2014, 12:28 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
You posted a picture of the EF model diagram in Visual Studio, bu I need to see the tables in Design View in SQL Server Management Studio instead. E.g. a screenshot of the screen where you define the columns for the tables.
Cheers,
Imar
|
|

February 12th, 2014, 10:35 AM
|
|
Authorized User
|
|
Join Date: Feb 2014
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
T-SQL Statemnts?
Is that what your referring to?
CREATE TABLE [dbo].[Picture] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Description] NVARCHAR (300) NOT NULL,
[ToolTip] NVARCHAR (50) NOT NULL,
[ImageUrl] NVARCHAR (100) NOT NULL,
[PhotoAlbumId] INT NOT NULL,
CONSTRAINT [PK_Picture] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_Picture_PhotoAlbum] FOREIGN KEY ([PhotoAlbumId]) REFERENCES [dbo].[PhotoAlbum] ([Id])
);
CREATE TABLE [dbo].[PhotoAlbum] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Name] NVARCHAR (100) NOT NULL,
CONSTRAINT [PK_PhotoAlbum] PRIMARY KEY CLUSTERED ([Id] ASC)
);
|
|

February 12th, 2014, 01:48 PM
|
|
Authorized User
|
|
Join Date: Feb 2014
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Problem fixed, but it wont cast
I was able to fix the problem by changing the code generation strategy to default, but when I try to request the page at the end of the try it out, it throws the error of not being able to cast over e.Entity with PhotoAlbum
|
|

February 15th, 2014, 10:44 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Are you using VS 2013 and ASP.NET 4.5.1 by any chance? They no longer support the LinqDataSource.
If that's not the case, can you provide detailed error information and your code?
Cheers,
Imar
|
|

February 16th, 2014, 05:00 PM
|
|
Authorized User
|
|
Join Date: Feb 2014
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
fixed it
fixed it by redo the steps over again and rebuilding it, using vs2012 by the way and framework 4.5
|
|
 |
|