tags:

views:

75

answers:

3

I've just deployed an ASP.NET web site to my hosting provider, but I keep getting the following error when I try and log in:

SQLExpress database file auto-creation error: The connection string specifies a local Sql Server Express instance using a database location within the applications App_Data directory.

I have already set up a DB with the required schema on the host, and I can even log in through the host DB from my dev machine, but not on the hosted site itself. My provider configuration is as follows:

<connectionStrings>
  <add name="Membership" connectionString="data source=localhost;initial catalog=bkelly_aspnetdb;user id=withheld; password=withheld;" />
</connectionStrings>
<system.web>
  <membership defaultProvider="SqlMembershipProvider">
    <providers>
      <clear/>
      <add name="SqlMembershipProvider" 
           type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
           connectionStringName="Membership" 
...

I find nothing at site level that suggests using the App_Data DB, but surely the directive should sort out any machine level provider config?

A: 

Might the problem be the disk that the file is on is compressed. This would produce the error you experienced

Stuart
@Stuart, what file? I'm trying to connect to a SQL Server database, so the fact that any file is involved is actually the root of my problem.
ProfK
I'm not certain that compression is the problem, just wanted to point you in the direction, so you can investigate. But sql server, the databases contained within are files. For instance in sql express the database file is .mdf, the log file is..ldf
Stuart
A: 

Under mono you have to replace the "SqlMembershipProvider" text to something else (doesn't matter unless it's something else) in your config. I don't think your host is using mono, but worth a try.

SztupY
A: 

Not 100% on this, but try adding

<clear/>

...before you add your connectionStrings section:

<connectionStrings>
  <clear/>
  <add name="Membership" connectionString="data source=localhost;initial catalog=bkelly_aspnetdb;user id=withheld; password=withheld;" />
</connectionStrings>
mxmissile