Webservice and database security

Is necessary to use from webservice for security of DB? I put my connection string (which has username and password of db) in web.config. Is it Security weakness? Must I put connection string in Webservice? If I put my connection string to webservice, the database security is be provided? Thanks very much