Am having a .net application and the while am connecting the my database , the password should generate dynamically and only from my application the db can be accessed..
I'm not sure what you mean by dynamically creating the password. Normally, if you only want your application to access SQL Server, you would use a SQL Login in you application's connection and only grant that login access to the database. You can store the connection string in a config file and encrypt it or store it in the registry and even encrypt it there.