p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 4 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=560)
-   -   Chapter 14 problem (http://p2p.wrox.com/showthread.php?t=86483)

Imar February 15th, 2012 12:36 PM

I don't understand it. It all looks good and exactly as it should. Your EF model uses a connection string that points to .\SqlExpress which in turn you can access. I really have no idea why this doesn't work.

Maybe removing the EF model (and the associated connection string from the web.config file) and the adding them again sheds some light?

Imar

Imar February 15th, 2012 12:40 PM

Quote:

but in the list of databases the PlanetWrox.mdf isnt there if that means anything?
Yeah, that makes sense and is expected. Using AttachDbFilename in the connection string the database is atatched on the fly and doesn't appear in SQL Server's database list.

Cheers,

Imar

Nick Makin February 15th, 2012 12:43 PM

Sorry for the confusion but I dont think I log in using SQL Server. When I was in the sql server management I could see any databases there and PlanetWrox.mdf wasnt there. Now I tried to modify the database connection in VWD, used sql server authentication and enter the details and go but it didnt let me log in.

Thanks for all the help Imar,

Nick

Imar February 15th, 2012 12:47 PM

Quote:

used sql server authentication and enter the details and go but it didnt let me log in.
And what details did you enter? No need to post the actual user name or password, but wondering how you got hold of this account. Notmally, Express uses Windows Authentication by default.

Did you use the same sql server account to log into Management Studio?

Imar

Nick Makin February 15th, 2012 12:47 PM

Wow, ive removed the connection and completely re-done it and its connected! I dont have a clue why it wasnt working before because none of its details like the address was changed, or it should of worked when I tried to re-do it previously. Im totally suprised that its working now!

I can now expand the database and can see the Genre and Review tables.

Thanks for the help Imar, so pleased I can now move on after all this.

Cant thank you enough,

Nick

Imar February 15th, 2012 04:12 PM

Good to hear. Hopefully this now also fixes your original problem with the Manage PhotoAlbum page....

Cheers,

Imar

Nick Makin February 22nd, 2012 12:10 PM

No still got the same problems but theyve got worse. I think modifying my database connection was a bad idea because know i cant find the orginal database file that i have been working with. My PlanetWrox.edmx reflects the database i had but i cant find the database for some reason which had all of my reviews and genres in, so with the PlanetWrox.edmx i can make a database from the relationships and do it that way.

Also then ill have to change the PlanetWroxEntities and PlanetWroxConnectionString1

Once all that is changed do you think that my project should be working again or do you think by doing this im just messing more things up because at the moment its all just really confusing me and want to get back on track.

Thanks,

Nick

Imar February 22nd, 2012 02:03 PM

Not sure how to answer that. Yes, it should fix all your problems once you configured everything correctly. But since I am a bit confused about what's not working, I can't recommend how to fix it.

Losing the database sounds bad, but I can't really recommend a way to get it back ;-) You can always grab the code and database from the previous chapter and use that as a starting point....

Imar

natsuto February 24th, 2012 01:19 AM

See what happens when you try to re-create them. You can also log on to SQL Server Management Kodak 10 Studio?

Nick Makin February 26th, 2012 10:29 AM

Quote:

Originally Posted by Imar (Post 281778)
Not sure how to answer that. Yes, it should fix all your problems once you configured everything correctly. But since I am a bit confused about what's not working, I can't recommend how to fix it.

Losing the database sounds bad, but I can't really recommend a way to get it back ;-) You can always grab the code and database from the previous chapter and use that as a starting point....

Imar

Ever since I found out my database was gone I have been using the databases from the source code, but every time I log into VWD I have to modify the connection to the database again. Ill try and re-do the connection strings to another database and see what happens,

Nick


All times are GMT -4. The time now is 11:50 AM.

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