Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
|
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 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 March 23rd, 2014, 04:46 PM
Registered User
 
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
 
Old March 23rd, 2014, 05:00 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
 
Old March 23rd, 2014, 05:36 PM
Registered User
 
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)
 
Old March 23rd, 2014, 05:49 PM
Registered User
 
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...
 
Old March 23rd, 2014, 06:02 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
 
Old March 23rd, 2014, 06:57 PM
Registered User
 
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?
 
Old March 23rd, 2014, 06:59 PM
Registered User
 
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..
 
Old March 24th, 2014, 07:52 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
 
Old March 24th, 2014, 10:50 AM
Registered User
 
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..
 
Old March 24th, 2014, 03:57 PM
Registered User
 
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





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





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