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
Whta are the Various steps taken to optimize a web based application (caching, stored procedure etc.) ?
Explain code snippet to register exception filters from controller?
How can you handle errors in Web API?
Which method do you use to kill explicitly a users session?
How does output caching work in ASP.NET?
while developing webservices if i want some users to use my webservice only how can i give security to my webservice?
What is IPostBack? How to use it?
Where is asp.net session stored?
How do you secure your configuration files to be accessed remotely by unauthorized users?
What is the difference between Session and response.Redirect?
Apart from IDE what are the enhancements in asp.net 2.0?
Is LINQ performance wise better or using sqlcommand?
What is the difference between rest and restful?
Suppose you want an asp.net function (client side) executed on the mouseover event of a button. Where do you add an event handler?
Define xmlreader class.