Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
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
 
Old February 10th, 2014, 01:42 PM
Authorized User
 
Join Date: Feb 2014
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
 
Old February 10th, 2014, 05:11 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 11th, 2014, 10:45 AM
Authorized User
 
Join Date: Feb 2014
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Diagram photo

Here is the model layout,

http://s560.photobucket.com/user/Tri...0886f.png.html
 
Old February 11th, 2014, 12:28 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 12th, 2014, 10:35 AM
Authorized User
 
Join Date: Feb 2014
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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)
);
 
Old February 12th, 2014, 01:48 PM
Authorized User
 
Join Date: Feb 2014
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
 
Old February 15th, 2014, 10:44 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 16th, 2014, 05:00 PM
Authorized User
 
Join Date: Feb 2014
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default fixed it

fixed it by redo the steps over again and rebuilding it, using vs2012 by the way and framework 4.5





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 14 Creating an MDI Application porsche993997 BOOK: Ivor Horton's Beginning Visual C++ 2010 0 February 13th, 2013 04:24 PM
CH 14 A Simple EntityDataSource Application - Error! leeWozyWarren BOOK: Beginning ASP.NET 4 : in C# and VB 5 December 7th, 2011 02:28 PM
Need help for creating simple jsp web application ogi.za.forum JSP Basics 0 August 15th, 2009 12:31 PM
simple application using Struts varun_java Apache Tomcat 0 February 17th, 2005 09:12 AM
Simple Query - c# Console application deployment dkb .NET Web Services 1 February 18th, 2004 12:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.