Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a web.config in ASP.net giving me configuration error.

 <connectionStrings>   
<add name="conn1" connectionString="Data Source=test;database=test;uid=test;pwd=test"/>
<add name="conn2" connectionString="Data Source=123.123.1.123;database=test2;uid=test;pwd=test"/>
...

It throws "The entry 'conn2' has already been added." error. I know I only added it once. Not sure what it is wrong with.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
552 views
Welcome To Ask or Share your Answers For Others

1 Answer

it can be in web.config that is parent to this one. just add

<remove name="conn2" />

before your add it (again) :)

alternatively clear all connection string using

<clear />

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...