I can't get my website to connect to the built-in db for ASP.NET login funtions (ASPNETDB.MDF). I've been trolling multiple forums for weeks now, and nothing seems to work. I've tried every combination I can think of but get some variation of 'cannot open database' or 'login failed'. Where am I going wrong?
The "connection info" (SQL Server 2008) given by my hosting site is "sql11.sqlsvr.net". I have verified that the user id and password are correct.
Using:
<add name="HostingConnectionString" connectionString="Data Source=sql11.sqlsvr.net;Database=App_Data\ASPNETDB.MDF;User id=administrator1 password=mypassword;Trusted_Connection=False;"
providerName="System.Data.SqlClient" />
results in
Cannot open database "App_Data\ASPNETDB.MDF" requested by the login. The login failed. Login failed for user 'administrator1'.
with trace (partial):
[SqlException (0x80131904): Cannot open database "App_Data\ASPNETDB.MDF" requested by the login. The login failed.
Login failed for user 'administrator1'.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4846887
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +35
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +144
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +342
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +221
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +189
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +31
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +433
Any suggestions would be helpful. Thanx.
[Other questions that have come up as I wandered in the connectionstring wilderness:
I have SQLExpress on my home/development computer, and SQL Server (2008) on the hosting site. Do/can they use the same connection strings?
Please explain "AttachDbFilename=" vs "Initial Catalog=" vs "Database="
Some website examples use "User Id=" (which seems work, sort of), while others use "uid" or other variations -- which don't work for me at all. Why? ]