This project is read-only.

Problem with tutorial

Jul 28, 2010 at 10:26 PM

Hi everyone.

Thanks for this tutorial, it's very simple and good, but i'm having some problems.

I'm using VS 2008 SP 1 with SQL 2005.

First: when i try to use the code storeDB.Genre.Single(...) trhows an exception on runtime (not supported), then i have to change to First(...)

Second: when i implemented the code to the Create action from StoreManager, the Artist and Genre of the Album are null, so it throws an exception when accessing the Create View. (Page 56)

Third: after make some changes related to fix the previous problem, the new Album created is not loading the Artist.Name and Genre.Name data, throwing an exception when trying to truncate them (using the helper).

Anyone knows why those errors are happening?



Jul 29, 2010 at 9:57 AM

I don't think that Sql 2005 can attach the datasource file(.mdf).

Besides,Are you using Linq to Sql or Linq to Entities?

Jul 29, 2010 at 12:54 PM
Edited Jul 29, 2010 at 1:48 PM

Hi. Thanks for your reply.

The database is fine. I used the generation script provided on the source code to create the database, and it's working fine.

I figured out now that when i added the album, a new genre and artist were created... probably the entity framework has done something i wasn't expecting...

Any ideas?


Jul 29, 2010 at 2:10 PM
Edited Jul 29, 2010 at 2:12 PM

Another thing: Html.EditorFor is generating the makup of the fieldset and the submit button, which means that there are 2 buttons and 2 fieldsets on my edit/create views