 |
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
 | This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB 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
|
|
|
|
|

January 29th, 2017, 10:34 PM
|
|
Authorized User
|
|
Join Date: Apr 2016
Posts: 11
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Hi,
Well, it turns out that I may be okay after all?
My understanding is that LocalDB is installed with VS (I did choose SQL Server Data Tools when I installed VS). Though I was unclear exactly how to connect to it. Searched online and found a very helpful post:
http://stackoverflow.com/questions/2...erver-explorer
In SSMS, I 'thought' I had tried logging in to a SQL Server LocalDB instance, using (LocalDB)/v11.0 as the server name, and it failing. Just recently I tried it and it worked! So I recreated the PlanetWrox database that way, and am now able to connect to it from VS without error. So, this being the case, will I be okay going through the rest of the book?
|
|

January 31st, 2017, 09:18 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Yep, with (LocalDB)\v11.0 you should be good to go...
Imar
|
|

April 12th, 2017, 11:35 PM
|
|
Authorized User
|
|
Join Date: Mar 2017
Posts: 55
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
Same error
I too am having the same error, but here are some facts that I hope might be helpful in troubleshooting my issue.
I have a version of 2016 SQL Management Express (probably no big deal?)
I installed 2012 SQL Express as a side by side.
I did not install LocalDB
I am using a computer from home that has a VPN into my work.
The instance I created was SQL2012Express
I was able to open 2012, and create the wrox DB from the script download.
The mdf file was appropriately added to my App_Data folder.
When I logged into SQL 2012 Express, I could not use (LocalDB)v11.0
I had to instead use DEVSPARE\SQL2012Express
I THINK that DEVSPARE might be a server from the work VPN, not my local.
But I don't know that for sure.
I did create PlanetWrox DB once and then delete it and then create it using the script. Could this be the "already open" issue - or does this have something to do with permissions?
The reason I think this may be from my VPN at work is because the instance full name is: DEVSPARE\SQL2012EXPRESS (SQL Server 11.02100 - FOXHQ\DanielP)
FOXHQ is a domain that I use for my work log in.
Any ideas? I can get access to the DB in SQL 2012 - easily. But I can't attach or connect via VS 2015.
|
|

April 12th, 2017, 11:44 PM
|
|
Authorized User
|
|
Join Date: Mar 2017
Posts: 55
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
VS 2015 and SQL Server 2016 v 2012
Hello Imar:
If I want to skip the 2012 exercises and just use the controls with a DB in my 2016 SQL MS instead, how do I create an instance for my own purposes instead of reinstalling 2016?
For example, My 2016 SQL has a connection (instance) for my work on a server called Scorpio. I don't want to mess with that. How do I connect to my own local instance w/out reinstalling anything?
|
|

April 13th, 2017, 03:45 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>> I did not install LocalDB
...
>> When I logged into SQL 2012 Express, I could not use (LocalDB)v11.0
That makes sense to me. Hard to log into something that's not installed ;-)
You should be able to connect to DEVSPARE\SQL2012Express or just
.\SQL2012Express. Did you try this from within SSMS?
Imar
|
|

April 13th, 2017, 09:46 AM
|
|
Authorized User
|
|
Join Date: Mar 2017
Posts: 55
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
2012 SQL Instance
I was able to use DEVSPARE\SQL2012EXPRESS, yes.
But when I tried to connect in VS 2015, I got the same connection error as stated in another post. I tried to manually connect, by right clicking on add connection as an alternative to double clicking the mdf file, but the dialog box told me that I didn't have permissions on the file. But I can access the same DB from within SSMS.
Also, can you please tell me how to create another instance in my already installed SSMS 2016. I need to "keep" the work instance I have, but create another one for myself.
Last edited by papadan; April 13th, 2017 at 09:50 AM..
|
|

April 16th, 2017, 05:21 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
It could be a permissions issue where you as a user have access to the file but the account used by SQL Server doesn't; hard to tell. I would install LocalDB side by side as it makes this stuff a lot easier to deal with.
>> Also, can you please tell me how to create another instance in my already installed SSMS 2016. I need to "keep" the work instance I have, but create another one for myself.
You can rerun the SQL Server installer and it should allow you to install another instance with a different instance name. Why would you want this?
Imar
|
|

April 16th, 2017, 02:59 PM
|
|
Authorized User
|
|
Join Date: Mar 2017
Posts: 55
Thanks: 12
Thanked 0 Times in 0 Posts
|
|
Instance issues
Thanks, I understand now how to create another instance, but yes, you were also correct in wondering why I would need one. It turns out that I didn't, and I was okay now. But I'm not okay double clicking the mdf file, I still get that same error everyone else is getting.
However, I'm up and running now with a connection to my DB. I can't remember how I did it, but there is an mdf file in my folder, and I do have a connection that's allowing me to drag tables, etc. and carry forward with the book instructions. I just can't seem to establish a connection by double - clicking on the file.
When I first tried to manually connect (before my posts here) it would not show the database. But after I started again, it did. Maybe in reinstalling (trying to get another instance - which I am not using, by the way) - I somehow refreshed objects or what have you.
In any case, the bottom line is that I still have a red "X" on my connection, but I'm accessing tables and have a connection string in web.config that's working for me. Go figure...
This is why I want to stay employed as a developer and never apply for any SQL Admin jobs!
|
|
 |
|