how to encrypt a connection string in web.config file?
Answer Posted / anand gopal makwa munger
write the code on web.config file Like below
<configuration>
<appSettings/>
<connectionStrings>
<add name="Connection" providerName="System.Data.SqlClient" connectionString="server=abc\Sqlexpress;IntegratedSecurity=SSPI;DataBase=XYZ"/>
</connectionStrings>
</configuration>
and write the code Behind page(ie .cs File)
ConnectionStringSettings con = ConfigurationManager.ConnectionStrings["Connection"];
SqlConnection conn = new SqlConnection(con.ConnectionString);
| Is This Answer Correct ? | 0 Yes | 5 No |
Post New Answer View All Answers
What is considered a service provider?
What is the use of placeholder control?
What is the difference between asp.net and mvc?
What are the advantages of the code-behind feature?
In Code-Behind class which kind of code (server or client) is found ?
How many languages are supported by .NET at present time?
Why cyclomatic complexity is important?
How to integrate angular 8 with asp.net mvc 5? : Asp.Net MVC
What is cookies cache and session?
Which ASP.NET configuration options are supported in the ASP.NET implementation on the shared web hosting platform?
Why Unload event of MasterPage Calls first in ASP.net ?
How to change Master page in ASP.Net using code?
What is caching? What are different ways of caching in asp.net?
What is cookies in asp net?
How many types of sessions in asp.net?