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 .
I am a beginner but things have been going quite smoothly until this exercise on page 497 onwards on EntityDataSource control. I was find until step 8 when despite being data source being configured properly (as far as I can see!), the DetailsView control's columns won;t refresh to show Id and Name columns! When I try to refresh, I get an error message saying "Could not find CLR type for PlanetWroxModel.Photoalbum".
I would be grateful to get your help - I just can;t see anything wrong anywhere!
I have really enjoyed this book so far.
Can you provide more information, such as the relevant code for the pages. Also, make sure you database was setup correctly (primary and foreign keys and so on) before you create the EDMX diagram.
And what about the other info? Is the database set up correctly? How did you define the primary and foreign keys? And did you update the database before you created the model? And how exactly did you create this demo page? And is Photoalbum the right name or should it be PhotoAlbum?
Finally, when you use the sample page that comes with this book's download, does it work? (I am trying to find out of the issue is in the code, the model or the database).
If I compare my code with yours, I can see a few differences:
1. I don't have an Imports for the PlanetWroxModel namespace
2. You have an EntityTypeFilter set to Photoalbum which you don't need.
There are other differences but they shouldn't matter. What happens when you remove these two statements?
Also, my code has a DataKeyNames and yours doesn't, possible indicating an issue with the primary key in the database.
Quote:
Finally, when you use the sample page that comes with this book's download, does it work?
Yes.
Did you just copy in the code for this page (that is, are you using your model and database) or are you testing this on the full sample project?
If this still doesn't work, send me zipped copy of the project with just the necessary files to reproduce the problem and I'll take a look. My e-mail address is in the beginning of the book.