asp.net - Connection Strings -
could me understand piece of code in simple english? beginner. thank in advance.
<connectionstrings> <add name="balloonshopconnection" connectionstring="server=(local)\sql➥ express; database=balloonshop; user=balloonshop; password=ecommerce" ➥ providername="system.data.sqlclient" /> <remove name="localsqlserver"/> <add name="localsqlserver" connectionstring="server=(local)\sqlexpress;➥ database=balloonshop; user=balloonshop; password=ecommerce" providername=➥ "system.data.sqlclient" /> </connectionstrings>
this tutorial. covered first half of book seems strange.
the web.config app part of configuration settings app gets. total configuration combination of web.config machine.config file, , settings defined in iis. line:
<remove name="localsqlserver"/>
implies there connection string named localsqlserver defined elsewhere may getting somewhere other web.config. in web.config explicitly removing other localsqlserver connection string otherwise get, , replacing 1 defined below line. change affects application. explained here: http://weblogs.asp.net/jgalloway/archive/2012/01/17/10-things-asp-net-developers-should-know-about-web-config-inheritance-and-overrides.aspx
if remove tag wasn't there, , connection string defined higher chain, app use 1 defined higher up, , ignore 1 defined in web.config (which can quite confusing!). that's why remove tag needed.
see also: avoid web.config inheritance in child web application using inheritinchildapplications
Comments
Post a Comment