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 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
Register | 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 May 14th, 2012, 11:36 PM
Authorized User
Points: 257, Level: 5
Points: 257, Level: 5 Points: 257, Level: 5 Points: 257, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Location: Healing, UK
Posts: 59
Thanks: 2
Thanked 4 Times in 4 Posts
Default LocalSQLServer in Development Mode vs Live on a Web Host

Hi Imar,

I am just coming to the end of Chapter 16 and at this point I have no issues regarding understanding what is going on. That said however, a question has been raised in my mind when I consider what I need to use when developing a site and running a site live with my web host.

My own web host does not allow me to define my own database names and therefore the ASPNETDB catalog will be called something else. This means that depending whether I am developing the site on my own machine or running the site with my web host I will need differently configured web.config files with the correct connection information.

I realise that I can simply copy saved web.config_Development or web.config_Live files to the web.config file but my question is, is there a specific ASP.NET way to overcome this issue or is there a more convenient/efficient way to overcome this issue of needing differently configured web.config files?

Thanks for any help you may be able to provide.

Kind regards,

Ian Ryder
Reply With Quote
  #2 (permalink)  
Old May 15th, 2012, 02:17 AM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Ian,

Unfortunately, there is no easy solution for web site projects. You can indeed maintain two copies, or never overwrite the live version and manually update other settings. Alternatively, and that's what I would suggest in this case, you can use the configSource attribute of the connection string element. This enables you to define the code for the connectionStrings element in a separate file. This way your main config file can be deployed while you should never overwrite the file with the connection strings (which remains a risk). Check out the section "Using External Configuration Files" in this article: http://msdn.microsoft.com/en-us/libr...(v=vs.80).aspx

For Web Application Projects, Microsoft created a much better solution: web config transformations: http://blogs.msdn.com/b/webdevtools/...formation.aspx
Unfortunately, this is not available for web site projects, the project type that the Planet Wrox site uses.

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
  #3 (permalink)  
Old May 15th, 2012, 03:55 AM
Authorized User
Points: 257, Level: 5
Points: 257, Level: 5 Points: 257, Level: 5 Points: 257, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Location: Healing, UK
Posts: 59
Thanks: 2
Thanked 4 Times in 4 Posts
Default

Hi Imar,

Thanks for the information. I suspected that this would be the case but its good to know either way.

Talk to you again soon.

Cheers,

Ian
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
How to Make Live Broadcast on the web page vivek.talkin ASP.NET 3.5 Professionals 1 December 1st, 2009 03:07 AM
How to Make Live Broadcast on the web page vivek.talkin ASP.NET 3.5 Basics 0 November 6th, 2009 09:08 AM
JSP Web host ironchef Pro JSP 1 December 3rd, 2007 11:47 PM
How do I host a web application ? nidhinasthra Classic ASP Basics 1 July 6th, 2005 10:57 AM



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


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