hi,
First you should keep your connectionstring in the web.config file of your application
and get the connectionstring in your code like this:
string connStr=ConfigurationManager.ConnectionStrings["myConnection"].ToString();
here myConnection is the name of ConnectionString in web.config file.
and if you store the connection string in any other file on your system then get it like
string connStr = File.ReadAllText("myFile.txt");
but the second one is not a good way.