Wrox Programmer Forums
|
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 March 30th, 2012, 05:03 AM
Registered User
 
Join Date: Mar 2012
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Ch.14 first try it out

Hi im stuck on step 9 of the first try it out on chapter 14. this is the error i get:

The type or namespace name 'PlanetWroxEntities' could not be found (are you missing a using directive or an assembly

Here is my code
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using planetWroxModel;

public partial class Reviews_All : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        using (PlanetWroxEntities myEntities = new PlanetWroxEntities())
        {
            var allReviews = from review in myEntities.Reviews
                             where review.Authorized == true
                             orderby review.CreateDateTime descending
                             select review;
            GridView1.DataSource = allReviews;
            GridView1.DataBind();
        }
    }
}
Also when I clicked 'PlanetWroxEntities ' and pressed ctrl + . I did not get the option to create the using statement for me.

I can only generate a class or new type.

And here is the code for the designer file

Code:
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="2.0" xmlns:edmx="http://schemas.microsoft.com/ado/2008/10/edmx">
 <!-- EF Designer content (DO NOT EDIT MANUALLY BELOW HERE) -->
  <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2008/10/edmx">
    <!-- Diagram content (shape and connector positions) -->
    <edmx:Diagrams>
      <Diagram DiagramId="564f075dc93f490a86a589ad8610513f" Name="Diagram1">
        <EntityTypeShape EntityType="planetWroxModel.Genre" Width="1.5" PointX="0.75" PointY="1.5" IsExpanded="true" />
        <EntityTypeShape EntityType="planetWroxModel.Review" Width="1.5" PointX="3" PointY="1" IsExpanded="true" />
        <AssociationConnector Association="planetWroxModel.FK_Review_Genre" ManuallyRouted="false" />
      </Diagram>
    </edmx:Diagrams>
  </edmx:Designer>
</edmx:Edmx>
Thanks
 
Old March 30th, 2012, 08:04 AM
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,

That doesn't look right to me. The EDMX file should be much bigger. Are you sure you added all the tables to the diagram as shown in the book?

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 March 30th, 2012, 09:06 AM
Registered User
 
Join Date: Mar 2012
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for the reply.

Im pretty sure. it was just the genre and reviews table that was said to be checked and then the sysdiagrams table to be left unchecked.

I skipped step 6 though because I am using an english version of VWD.
 
Old March 30th, 2012, 09:21 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, correct. That's what I mean. Can you see the tables on the diagram when you save all changes and close and reopen Visual 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 March 30th, 2012, 10:07 AM
Registered User
 
Join Date: Mar 2012
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yeah I can see both tables, I have uploaded a picture to show you what I can see
http://postimage.org/image/kh6cfbzcn/

Im using the VS2012 beta but I doubt that will cause a problem. (Did with the database but I sorted that out)
 
Old April 4th, 2012, 09:01 AM
Registered User
 
Join Date: Mar 2012
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I redone the try it out using the source files from Chapter13 and I have now solved the issue.

But have no idea why it didn't work in the first place... oh well.
 
Old February 10th, 2014, 11:50 AM
Authorized User
 
Join Date: Feb 2014
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Same Problem with entity model

I still having the same problem even with the source code from chapter 13
 
Old February 10th, 2014, 05:12 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,

Is this the same issue as discussed here? Chapter 14: Simple EntitySource Application try-it out

Make sure the tables are designed correctly, and only include the relevant tables in the EF diagram.

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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch.14 .NETFramework error smileys6971 BOOK: Beginning ASP.NET 4 : in C# and VB 8 February 25th, 2013 02:06 PM
Ch.14 - First try it out jxFive BOOK: Beginning ASP.NET 4 : in C# and VB 3 November 3rd, 2011 03:55 PM
Ch 14 Help digink BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 November 3rd, 2009 03:35 PM
ch.14 file errors caseyc BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 10 February 28th, 2006 03:59 PM
Ch. 14 Calendar Modification Astalder BOOK: Beginning ASP.NET 1.0 6 December 1st, 2004 06:23 PM





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