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
Explain the use of resource manager class in .net.
Can we handle the error and redirect to some pages using web.config?
What are resource file and how do we generate resource file?
Why is it preferred to not use finalize for clean up?
What is difference between view state and session state?
What are custom controls?
What does mean by a neutral culture?
Define tracing.
What are query strings used for?
Which library is used by the testers and developers to develop automated tests and create testing tools?
What is the difference between executescalar and executenonquery?
What are the security types in ASP/ASP.NET? Different Authentication modes?
What are the benefits of Razor View?
What is a uri query?
What is windows active directory authentication?