Reputation: 4921
I'm getting this error when I click Build Deployment Package.
I've read a bunch of related post regarding this issue but doesn't seems to answer the questions on my mind T_T.
This is my connection string on my Web.Config
<connectionStrings>
<add name="ApplicationServices" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />
<add name="ProjectPALEntities" connectionString="metadata=res://*/Models.ProjectPal.csdl|res://*/Models.ProjectPal.ssdl|res://*/Models.ProjectPal.msl;provider=System.Data.SqlClient;provider connection string=';data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\ProjectPAL.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework';" providerName="System.Data.EntityClient" />
</connectionStrings>
This is Package/Publish SQL Settings Under Project Properties. This is where I'm having a problem.
This is the connection string for the source database above.
data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\ProjectPAL.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework';
QUESTIONS:
In the Connection string for the source database which is the correct one to use?
data
source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\ProjectPAL.mdf;integrated
security=True;user
instance=True;multipleactiveresultsets=True;App=EntityFramework'; (this one is what I'm currently using)
metadata=res:///Models.ProjectPal.csdl|res:///Models.ProjectPal.ssdl|res://*/Models.ProjectPal.msl;provider=System.Data.SqlClient;provider
connection string=';data
source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\ProjectPAL.mdf;integrated
security=True;user
instance=True;multipleactiveresultsets=True;App=EntityFramework'; (with metadata or none of the above T_T)
Where could I get the Connection string for destination database? Sorry It's my first time to deploy a website. I researched but I can't find an answer T_T.
How could I possibly fixed this error?
Other Informations:
I changed " with ' (single quote) after reading this reference Explicit connection string for EF
I'm using Membership Provider and Role Provider and all my data is saved in ProjectPALEntities
If you need more Info just tell me. :)
Upvotes: 3
Views: 292
Reputation: 4921
Ok here's what I did.
I checkout new application from my repository and repeat every steps I did. When I click Import from web.config it automatically created this connection string for me under Connection string for source database.
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ProjectPAL.mdf;Integrated Security=True;Application Name=EntityFramework;User Instance=True
for the Connection string for destination database I just leaved it blank because I dunno what to put there.
When I clicked Build Deployment Package the error message doesn't shows anymore.
I wish I knew what to put ont the Connection string for destination database T_T
Upvotes: 1