connectionstring

T

Tony Johansson

Hello!

I changed in the configurationsettings for ASP.NET so the connection string
element below was saved in my web.config file

I just want to make it clear to me what this element <remove
name="LocalSqlServer" /> that exist in the beginning of the
connectionstrings element actually mean.

My first question is:
I mean that what it say is that forget everytning what is said from the
connectionstring named
LocalSqlServer. Is that correct understood ?

My second question is: If I remove this element <remove
name="LocalSqlServer" />
from my connectionstrings element can that cause problem in any way or is it
100% save to remove it.
If not 100% save can you say anything what might happen

<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="data
source=.\SQLEXPRESS;Integrated
Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;"
providerName="System.Data.SqlClient" />
</connectionStrings>

//Tony
 
Joined
May 16, 2006
Messages
27
Reaction score
0
By default, the machine.config will have the "LocalSqlServer" with some default connection string which gets loaded everytime when your application is running. If you want to use the same name "LocalSqlServer" to define your own connectionstring, you need to remove the entry added by machine.config as duplicate entry is not allowed in connection strings and for that purpose you have to use <remove name="LocalSqlServer"> in your web.config.
FYR, msdn.microsoft.com/en-us/library/bf7sd233.aspx
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top