Config file contain username and password to access the database
How can i hide it from user when am giving config file to user along with application

The best technique is to use a trusted connection. That way you don't need
to list a username or password so there is nothing to hide.
If this is not possible, you can store the username and password encrypted
in the registry. Another possible way is to store a hash of your password instead of your password and if you want to check the password compared the hash values

Here's more information: