Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 23rd, 2014, 04:46 PM
Registered User
Points: 36, Level: 1
Points: 36, Level: 1 Points: 36, Level: 1 Points: 36, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot connect to SQL Server 2008 R2 from VS 2013?

I'm on chapter 12 in ASP.NET 4 in C# in VB and it's covering SQL. It says that I should use SQL Server 2008, but I went for 2008 R2 because it seemed like a good idea. But, whenever I try to connect in Visual Studio, I get an Error 40: Could not open a connection to SQL Server. I can see my machine name, but all of the other boxes are empty. Sometimes, I get an error 52: Unable to locate installation but that's rare. When I open the Management Studio, it only gives me the two option (local) that do nothing. I don't know what to do here, it seems like nothing works.

Links:
My error 52: http://puu.sh/7GLCk.png
My error 40: http://puu.sh/7GM1A.png
The connection windows (Server name = My machine name): http://puu.sh/7GM4i.png
The configuration and management menus: http://puu.sh/7GMa5.png
Reply With Quote
  #2 (permalink)  
Old March 23rd, 2014, 05:00 PM
Imar's Avatar
Wrox Author
Points: 72,019, Level: 100
Points: 72,019, Level: 100 Points: 72,019, Level: 100 Points: 72,019, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,075
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Have you tried logging into .\SqlExpress?

Also, can you define "does nothing"? What happens when you log in to (local) using Management Studio?

Other things to check / try:

1. Try running Express under Network Service instead of your own account (see the image configuration and management menus)

2. Look in the Configuration Manager and see which instances you have running. Do you see one without a named instance (e.g. . or machinename) and one for SqlExpres?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old March 23rd, 2014, 05:36 PM
Registered User
Points: 36, Level: 1
Points: 36, Level: 1 Points: 36, Level: 1 Points: 36, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What do you mean by logging into ./SqlExpress? I've using that as a Server Name and as a User Name, but neither work. When I say "doing nothing", I meant hat it just sits around until it gets that same Error 40.

Also, as to your other suggestions:
1) I'm going to switch it to a Local Service, is that what you mean?
2) The only instances I have running under SQL Server Services (The only one that seems to be controlling the actual server) are the three pictured, SQL Server (SQLEXPRESS), SQL Server Agent, and SQL Server Browser (The last two are stopped)
Reply With Quote
  #4 (permalink)  
Old March 23rd, 2014, 05:49 PM
Registered User
Points: 36, Level: 1
Points: 36, Level: 1 Points: 36, Level: 1 Points: 36, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Using MySQL and PostgreSQL both result in the error Failed to call the ODBC driver connection utility. If anyone knows how to fix this error, I'm willing to use one of these Open Source databases at the cost of some syntax changes...
Reply With Quote
  #5 (permalink)  
Old March 23rd, 2014, 06:02 PM
Imar's Avatar
Wrox Author
Points: 72,019, Level: 100
Points: 72,019, Level: 100 Points: 72,019, Level: 100 Points: 72,019, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,075
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

.\sqlexpress (not ./sqlexpress) is the name of the sql instance to log in to. . refers to your local machine and sqlexpress is the name of the instance.

I meant Network Service, not local service. Network Service should be an option for the acccount to run sql server under on the settings /properties dialog doe your sql server.

You can't use the other database systems if yo want to follow along with the book.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #6 (permalink)  
Old March 23rd, 2014, 06:57 PM
Registered User
Points: 36, Level: 1
Points: 36, Level: 1 Points: 36, Level: 1 Points: 36, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Logging in with no credentials to a server named .\sqlexpress resulted in this, which I guess is a good sign. My installation was a mess, could I have missed something?
Reply With Quote
  #7 (permalink)  
Old March 23rd, 2014, 06:59 PM
Registered User
Points: 36, Level: 1
Points: 36, Level: 1 Points: 36, Level: 1 Points: 36, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got the server up, but connecting through Visual Studio results in this error: http://puu.sh/7H7H7.png
All of the solutions I've found haven't worked, and they all seem to be for an older version. I got the files corresponding to my version, but it hasn't fixed the problem.

Last edited by ThePlatinumTaco; March 23rd, 2014 at 09:46 PM..
Reply With Quote
  #8 (permalink)  
Old March 24th, 2014, 07:52 AM
Imar's Avatar
Wrox Author
Points: 72,019, Level: 100
Points: 72,019, Level: 100 Points: 72,019, Level: 100 Points: 72,019, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,075
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

It looks like your installation is messed up. Try uninstalling SQL Server Express and then reinstall. Also, try repairing Visual Studio.

About your question on MySQL: the book targets SQL Server, and as such most of the examples will not work with MySQL or another database.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #9 (permalink)  
Old March 24th, 2014, 10:50 AM
Registered User
Points: 36, Level: 1
Points: 36, Level: 1 Points: 36, Level: 1 Points: 36, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok. I did an install repair on Visual Studio, and I was able to connect afterwards. But, even after I connected, double clicking the database did nothing. I tried right clicking and making it connect to the server, but that resulted in this error: http://puu.sh/7HDsW.png . Running Visual Studio as an administrator gave me this: http://puu.sh/7HDxC.png .So I figured that I would try to attach the database, but, of course, that didn't work either. This is the error I got back: http://puu.sh/7HDaL.png

Last edited by ThePlatinumTaco; March 24th, 2014 at 10:55 AM..
Reply With Quote
  #10 (permalink)  
Old March 24th, 2014, 03:57 PM
Registered User
Points: 36, Level: 1
Points: 36, Level: 1 Points: 36, Level: 1 Points: 36, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is this the correct contents of the database? http://puu.sh/7HY9a.png :D
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Change background color based on two field data at SQL Server 2008 R2 jjjane BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 June 1st, 2012 11:53 AM
Can I use SQL Server 2008 R2 RTM Express with Advanced Services thehose BOOK: Knight's Microsoft Business Intelligence 24-Hour Trainer 0 April 12th, 2012 04:08 PM
Need Help with Classic ASP on Window Server 2008 R2 Nishapd Classic ASP Basics 0 November 7th, 2011 12:50 PM
Php 5.38 Connect SQL Server 2008 DennisThen PHP How-To 1 November 1st, 2011 03:50 AM
Can I host SQl 2008 R2 database in SQL 2005 Server? anantgupta ASP.NET 4 General Discussion 0 July 2nd, 2011 02:43 AM



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


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