Yes, you can change the default connection string for Membership/Profile.
Default connection is added in machine.config (you can find it in
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config):
<membership>
<providers>
<add name="AspNetSqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"
enablePasswordReset="true" requiresQuestionAndAnswer="true"
applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="1" passwordAttemptWindow="10"
passwordStrengthRegularExpression="" />
</providers>
</membership>
<profile>
<providers>
<add name="AspNetSqlProfileProvider"
connectionStringName="LocalSqlServer" applicationName="/"
type="System.Web.Profile.SqlProfileProvider, System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</profile>
It's easy to replace default settings in web.config file using remove or
clear elements:
<connectionStrings>
<clear />
<add name="localSqlServer" connectionString="server=servername;user
id=username;password=mypassword;database=databasename"/>
</connectionStrings>
Done.
Hope this helps