It is highly recommended to create connection string in web.config file because if at later stage you need to make changes in your connection string than you only need to change it once. Check this post and please provide your suggestions.
Read this post on techiners.blogspot.com