Wrox Programmer Forums
|
BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer
This is the forum to discuss the Wrox book Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer by Rod Stephens; ISBN: 9780470596906
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 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 October 29th, 2013, 02:32 PM
Authorized User
 
Join Date: May 2013
Posts: 41
Thanks: 0
Thanked 0 Times in 0 Posts
Default Lesson 38 Build Customer Database

Page 424 has a notation box on how to build a SQL database called Customer.mdf, for people who have access to SQL Server.

The book calls it a "program", so I was expecting an .exe, but instead it is a Solution. You load the solution into Visual C#, and then run it.

That's fine, but I had to overcome a few problems. For one, when running the solution you get a text box asking where the SQL server is located, but you have to figure out that that is what the text box is asking.

It's just a text box that says "GOTHMOG./SQLExpress" , and a button labeled Create Database.

You have to figure out how to change it to the path to your own SQL server.

This may have been covered in the book before, I don't remember. But as I have SQLExpress loaded on this computer, I was able to change the path to just :

./SQLExpress

and it worked.

However, once the Customer database was created, I could not attach to it. Windows 7 gave me the error message that I did not have permission to open the file, and that I needed to contact the owner of the file.

I had to go through the complicated process of Taking Ownership of the file, and once having done that, had to Allow Full Permissions to my username.

However, after doing all this, I was still unable to attach the database. The new error was that I did not have permission to open the LOG file! I had to go back and go through the whole Take Ownership process AGAIN to give myself permission (on MY OWN COMPUTER!!) to open the database log file!!

After doing so, the database was accessible to Lesson 38, Exercise 2.

What a nightmare!
 
Old October 29th, 2013, 02:57 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

Hi John,

Sorry that one was such as hassle.

The permission issues may have been caused by the fact that you downloaded files from the internet. Different versions of Windows handle this is different ways but the more recent versions flag the file as suspicious. Then programs like Visual Studio simply refuse to open them instead of telling you what the problem is. Sorry you have to figure that out for yourself.

Re. program versus solution. Technically a Visual Studio solution includes one or more projects, which are usually assemblies. Most of my solutions (in the book and for my own use) contain a single project. You can open a project instead of the solution that contains it, but if the solution only contains one project it doesn't matter much.

If by "program" you meant a compiled executable, I never provide those for download so they can never be infected with viruses.

Sorry getting SQL Server to work was hard. I find it (and all database programming) has a few things like the connection string that are just plain cryptic. (I think both this and the file ownership issues get worse with every new version of Windows and Visual Studio.)

Hopefully others will benefit from your explanation about using ./SQLExpress, and your other comments about taking ownership of files.

Sorry again that this was such an ordeal.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Lesson 38 - Using Linq to Sql with Access cmptmngt BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 1 January 20th, 2012 02:47 PM
How to build a form that searches your database Gayle Taylor PHP How-To 0 March 11th, 2011 06:05 PM
CUSTOMER DATABASE USING VB.NET sammy.com Visual Basic 2008 Essentials 0 September 4th, 2009 04:52 AM
Customer Contact Database Corey Access 0 March 27th, 2006 12:33 PM
Extract build data from Oracle database chandra1977 Oracle 1 March 11th, 2004 02:22 PM





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