Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Whta are the Various steps taken to optimize a web based application (caching, stored procedure etc.) ?

971


Explain code snippet to register exception filters from controller?

974


How can you handle errors in Web API?

1049


Which method do you use to kill explicitly a users session?

1002


How does output caching work in ASP.NET?

903


while developing webservices if i want some users to use my webservice only how can i give security to my webservice?

1795


What is IPostBack? How to use it?

1038


Where is asp.net session stored?

890


How do you secure your configuration files to be accessed remotely by unauthorized users?

1061


What is the difference between Session and response.Redirect?

1089


Apart from IDE what are the enhancements in asp.net 2.0?

2068


Is LINQ performance wise better or using sqlcommand?

5006


What is the difference between rest and restful?

1003


Suppose you want an asp.net function (client side) executed on the mouseover event of a button. Where do you add an event handler?

987


Define xmlreader class.

952