I am trying to have access to my project from the browser, I have put it on my server .
My database is on SQL Server 2008 R2 .
When I try to login I have always
The AttachDbFileName=
feature is available ONLY in the SQL Server EXPRESS edition. It is NOT compatible and supported on a "full" SQL Server installation.
If you have a full SQL Server, you have to attach your database to the SQL Server instance, and then reference it by its (logical) database name - not the physical file name:
<connectionStrings>
<add name="LocalSqlServer"
connectionString="server=.;database=DataUi;Integrated Security=SSPI;"
providerName="System.Data.SqlClient" />
</connectionStrings>
I think there's a missing \\
in your AttachDBFilename
right after |DataDirectory|
:
AttachDBFilename=|DataDirectory|\\DataUi.mdf
You should "Database" rather than "AttachDbFileName" as it is not recommended for production servers.
Hence your connection string should be:
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Initial
Catalog=DataUi;Integrated Security=SSPI;Database=DataUi.mdf;User
Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings>