You PROVIDE a connection string to your app so it can know how to connect to your database. This is usually done in the app.config file, something like this:
<configuration>
<connectionstrings>
<add name="MyAppDatabase" providername="System.Data.SqlClient" connectionstring="Server=.;initial catalog=MyApplicationDb;Integrated Security=True;" />
</connectionstrings></configuration>
But, of course, what you put in this string is entirely dependent on the database engine you're using, how you're connecting to it, and what kind of security credentials you have to provide and how.