Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 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 January 24th, 2008, 06:56 AM
Authorized User
 
Join Date: Jul 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Remove the LocalSqlServer entry from machine.confi

Chapter 3
Design

If you choose to rename the file, you can create a new connection string element under <connectionStrings>, and change all elements' connectionStringName attribute to your new connection string name.

That is right

A more drastic option would be to remove the LocalSqlServer entry from machine.config, and then register it again with the new connection string. Here is what you would need to write (in machine.config):

But I don't understand this sentence.

If I want to change the LocalSqlServer to some other server it can be changed in web.config. No need to change it in machine.config

Can anyone tell me what is the point raised by the Author.

 
Old January 24th, 2008, 01:26 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

The name "LocalSqlServer" is defined in machine.config. That means, even if you never define it in web.config <connectionStrings>, your app would use the default credentials from machine.config and still work.

You'll notice it says, in the first sentence, that you would have to wade through all your code, and rename all your elements that use "LocalSqlServer" to your new name. Let's say you did not want to do that. If you simply changed the connection string in that one place (machine.config), you could force all of your elements to use your new connection string without changing the name they point to.

 You are correct, of course, that there's really no need to do that, if you define "LocalSqlServer" in web.config. But the author is merely pointing out that it is possible.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Retore Db from a remote machine to a local machine srkvellanki BOOK: Beginning SQL 0 October 3rd, 2008 05:17 PM
Modifying LocalSqlServer at runtime TwoTrees ASP.NET 3.5 Professionals 7 July 29th, 2008 12:12 PM
date entry Tim Johnson Access 1 December 26th, 2007 08:18 AM
Always a New entry scandalous Access 3 January 26th, 2007 04:02 PM
Copy from one machine to another machine somnath.kartic SQL Server 2000 2 January 12th, 2006 03:13 PM





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