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

March 23rd, 2014, 04:46 PM
|
|
Registered User
|
|
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

March 23rd, 2014, 05:00 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

March 23rd, 2014, 05:36 PM
|
|
Registered User
|
|
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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)
|
|

March 23rd, 2014, 05:49 PM
|
|
Registered User
|
|
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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...
|
|

March 23rd, 2014, 06:02 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
.\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
|
|

March 23rd, 2014, 06:57 PM
|
|
Registered User
|
|
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|

March 23rd, 2014, 06:59 PM
|
|
Registered User
|
|
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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..
|
|

March 24th, 2014, 07:52 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|

March 24th, 2014, 10:50 AM
|
|
Registered User
|
|
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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..
|
|

March 24th, 2014, 03:57 PM
|
|
Registered User
|
|
Join Date: Mar 2014
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Is this the correct contents of the database? http://puu.sh/7HY9a.png :D
|
|
 |