Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 .
DRM-free e-books 300x50
Thread Tools Display Modes
  #1 (permalink)  
Old October 29th, 2013, 03:32 PM
Authorized User
Points: 179, Level: 3
Points: 179, Level: 3 Points: 179, Level: 3 Points: 179, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
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 :


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!
  #2 (permalink)  
Old October 29th, 2013, 03:57 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,187, Level: 23
Points: 3,187, Level: 23 Points: 3,187, Level: 23 Points: 3,187, Level: 23
Activity: 50%
Activity: 50% Activity: 50% Activity: 50%
Join Date: Jan 2006
Location: , , .
Posts: 646
Thanks: 2
Thanked 96 Times in 95 Posts

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 Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 05: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

All times are GMT -4. The time now is 12:33 AM.

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