You can place it where ever you want. the "web.config" is a good idea (but make sure you encrypt it if it has the login info (password).

And there is no 1 connection string format, you can check this website for methods to build your connection string