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 the difference between GridView and Repeater controls in ASP.NET?
Why is string called immutable data type?
What is caching? Explain.
Which methods validate all the controls on a page?
How would you implement inheritance using c#?
What is the difference between abstract class vs interface? Can give me the real time examples?
Define a static class?
Explain server control extensibility with reference to asp.net 2.0 ?
What are strong names?
Can you edit data in the Repeater control? Which template must you provide, in order to display data in a Repeater control? How can you provide an alternating color scheme in a Repeater control? What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?
What is a global postback url?
Explain the use of duration attribute of @outputcache page directive.
Explain the use of resource manager class in .net.
Why is global asax is used for?
Why we use content place holder in asp.net?