p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 4.5 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=710)
-   -   Chapter 14 - Using Data Controls with the Entity Framework (http://p2p.wrox.com/showthread.php?t=90467)

nudirection July 8th, 2013 09:49 PM

Chapter 14 - Using Data Controls with the Entity Framework
 
Hello Imar,

In the Try It Out, A Simple EntityDataSource Application, item 4, my PhotoAlbum and Picture tables aren't showing up when I choose Update Model from Database. I just see the sysdiagrams.

Regards, Mark

Imar July 9th, 2013 02:47 AM

Hi Mark,

Maybe an obvious question, but did you add the tables to the correct database?
And are the tables visible in the Refresh / Update tab of the wizard (can't remember the exact tab name)? That would be the case if you added them earlier.

Otherwise, I am not sure what's going on; all tables that are not on the diagram yet should appear in the list of new tables.

Cheers,

Imar

nudirection July 10th, 2013 06:13 PM

That's probably what happened. I added the new tables to my PlanetWrox database, but I guess I pulled the tables from the PlanetWroxTemp into my PlanetWrox.edmx file in VB. I don't recall now. Guess I shouldn't have deleted my PlanetWroxTemp database so quickly. The strange thing is my PlanetWrox database points to my C:\BegASPNET\Site\App_Data folder and I don't recall setting it up that way. Is there a way to tell the database to move the files to my C:\Databases folder? It's empty now. Or do I just need to restart at Chapter 12 again?

Also, would you know why I have a DevelopmentStorageDb201210 database? I don't know where that came from either.

I am such a noob. [:o]

Imar July 11th, 2013 02:29 AM

Hi there,
Quote:

Guess I shouldn't have deleted my PlanetWroxTemp database so quickly.
The Temp database was only used to demonstrate some concepts. You don't need it for the PlanetWrox site.

Quote:

The strange thing is my PlanetWrox database points to my C:\BegASPNET\Site\App_Data folder
That's where you added it when you created the MDF file initially (when you followed the exercises). During development, having the database in Ap_Data can be quite handy as you can copy the entire site from one location to another, without external dependencies like a database.

You can move the database to C:\Databases but then you have to update the attachdbfilename attribute in Web.config to point to C:\Databases or you can attached the database to SQL Server and then update your connection strings to point your local server and database name instead of its location (using Initial Catalog). Appendix B has more info.

Cheers,

Imar


All times are GMT -4. The time now is 02:06 AM.

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