You have to do it through the web.config
Add the following, and read more about how to invoke database calls from your web app.
<connectionStrings>
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
</connectionStrings>
Read the following for more details.
http://msdn.microsoft.com/en-us/library/ms178411.aspx