Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 December 19th, 2014, 05:23 PM
Registered User
Points: 37, Level: 1
Points: 37, Level: 1 Points: 37, Level: 1 Points: 37, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2014
Posts: 10
Thanks: 2
Thanked 1 Time in 1 Post
Default Chapter 16

Just so you know, I wound up doing a fresh install of windows and of VS2013. I got to a point where I was having issues where sometimes the database would connect to SQL server 2008 and sometimes 2012. 2012 worked, 2008 didn't. I figure I would remove the problem by having only one server.

I wanted to practice using the login controls from Chap 16, so I created a new project, dragged the controls onto the page. Ran the page and I get:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Now if I use the site template (not the empty one) it makes a database just fine, so I can't figure out what setting I need to change to make this work for me.

Before I reinstalled everything, I had it working in both 2010 and 2013. With the new installs, not so much.
Reply With Quote
  #2 (permalink)  
Old December 19th, 2014, 06:09 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Maybe you no longer have a SQL instance called .\SqlExpress? You can set the default instance that VS targets under Tools | Options | Database Tools | Data Connections.

Hope this helps,

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
The Following User Says Thank You to Imar For This Useful Post:
Harpist (December 20th, 2014)
  #3 (permalink)  
Old December 19th, 2014, 08:52 PM
Registered User
Points: 37, Level: 1
Points: 37, Level: 1 Points: 37, Level: 1 Points: 37, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2014
Posts: 10
Thanks: 2
Thanked 1 Time in 1 Post
Default Database

my database is (localDB)\v11.0.

HOw to I create a server named .SQLExpress?
Reply With Quote
  #4 (permalink)  
Old December 20th, 2014, 07:37 AM
Registered User
Points: 37, Level: 1
Points: 37, Level: 1 Points: 37, Level: 1 Points: 37, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2014
Posts: 10
Thanks: 2
Thanked 1 Time in 1 Post
Default .\SQLEXPRESS

Quote:
Originally Posted by Imar View Post
Maybe you no longer have a SQL instance called .\SqlExpress? You can set the default instance that VS targets under Tools | Options | Database Tools | Data Connections.

Hope this helps,

Imar
This turned out to be the right case. Setting the default instance did not work. What finally worked for me was:

<remove name ="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="data source=(LocalDB)\v11.0;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspn etdb.mdf" providerName="System.Data.SqlClient" />

in the web.config file. After what you said, I did a ton of searching on line and eventually found what I needed right in the book in the same chapter. Between what I learned online and what you provided in the book, I was able to replace the connection string used by membership database.

Now I just have to figure out why I don't have SQLEXPRESS installed or how to install it in case anything else uses it by default. Any insight for that?

The Harpist.
Reply With Quote
  #5 (permalink)  
Old December 21st, 2014, 11:26 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

>> Now I just have to figure out why I don't have SQLEXPRESS installed or how to install it in case anything else uses it by default. Any insight for that?

Appendix B has details on installing Management Studio for SQL Server Express. Alternatively, go here: http://msdn.microsoft.com/en-us/eval.../dn434042.aspx or search on Google for "install SQL Server Express"

You could also install LocalDB. It should have been installed with Visual Studio but maybe you uninstalled it? This link shows some articles that'll help you out installing it: https://www.google.nl/?gfe_rd=cr&ei=...Server+localdb

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 December 21st, 2014, 02:27 PM
Registered User
Points: 37, Level: 1
Points: 37, Level: 1 Points: 37, Level: 1 Points: 37, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2014
Posts: 10
Thanks: 2
Thanked 1 Time in 1 Post
Default SQL Server

localDB is what I'm using now. I'm mostly concerned if I come across something else that defaults to .\SQLEXPRESS.

I also wanted to say thank you very much. Your book is well written for teaching beginners .NET. I have found it extremely helpful in developing skills. And you have been incredible helpful with the troubles I have had.

I have just purchased your new book for 4.51 and I plan to go through that when it comes, hopefully tomorrow.
Reply With Quote
  #7 (permalink)  
Old December 21st, 2014, 03:34 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

LocalDB and SqlExpress are functionally equivalent for a large part. LocalDB is meant for development, while SqlExpress is designed for small production scenarios (although i can be used for development as well).
Quote:
I also wanted to say thank you very much. Your book is well written for teaching beginners .NET. I have found it extremely helpful in developing skills.
Good to hear! You're very welcome!

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
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
chapter 16 zedjr BOOK: Beginning ASP.NET 4 : in C# and VB 1 August 19th, 2011 09:39 AM
Chapter 16 Fig 16-11 krsouthern BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 1 July 8th, 2008 12:11 PM
Chapter 16 czambran BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 April 11th, 2005 11:01 AM
chapter 16 ?? farsfar2 BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 11 March 26th, 2005 10:01 PM
Help in Chapter 16 aldwincusi VB.NET 2002/2003 Basics 2 June 4th, 2003 09:52 AM



All times are GMT -4. The time now is 11:18 PM.


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