Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 10th, 2014, 01:42 PM
Authorized User
Points: 50, Level: 1
Points: 50, Level: 1 Points: 50, Level: 1 Points: 50, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
Reply With Quote
  #2 (permalink)  
Old February 10th, 2014, 05:11 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #3 (permalink)  
Old February 11th, 2014, 10:45 AM
Authorized User
Points: 50, Level: 1
Points: 50, Level: 1 Points: 50, Level: 1 Points: 50, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #4 (permalink)  
Old February 11th, 2014, 12:28 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #5 (permalink)  
Old February 12th, 2014, 10:35 AM
Authorized User
Points: 50, Level: 1
Points: 50, Level: 1 Points: 50, Level: 1 Points: 50, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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)
);
Reply With Quote
  #6 (permalink)  
Old February 12th, 2014, 01:48 PM
Authorized User
Points: 50, Level: 1
Points: 50, Level: 1 Points: 50, Level: 1 Points: 50, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #7 (permalink)  
Old February 15th, 2014, 10:44 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #8 (permalink)  
Old February 16th, 2014, 05:00 PM
Authorized User
Points: 50, Level: 1
Points: 50, Level: 1 Points: 50, Level: 1 Points: 50, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:19 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.