Hi,
In web.config file we have add name and add key what is the difference b/w them?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pravin MorePosted Nov 11, 2011, 12:41 AM
see there are 2 ways...
for e.g:-
1.
2.
see, in key-value we can use anything database connection or file path etc.....
where as in name-Connectionstring,i thinks it spetially for database connection.
n If you separate your connection strings into the
section, your config will be easier to read, maintain, and handle.Thanks
pravin.
Datta KharadPosted Nov 11, 2011, 1:15 AM
You will have to use the "standard" way and also you can encrypt connection string.
Using add key you can not encrypt connection string, it will through error "Unrecognized attribute 'key'.."
add name used in Connectionstring tag of web.config file, it will give name of connection string while add key used in appsettings tag of web.config file.
Please mark as Accepted answer if your query resolved.
Kunal NaikPosted Nov 11, 2011, 12:37 AM
add name used in connectionstring tag of web.config file, it will give name of connection string while add key used in appsettings tag of web.config file, it will give name of data string.
appSettings is meant for any data string that can be stored while connectionString is meant for storing the
database connection strings only.