简体   繁体   中英

No connection string named 'CarAccountingEntities' could be found in the application config file

Created a small test application on WPF and linked it to a local database via ADO.Net. I just implemented data output from the database via DataGrid. Everything works fine on my computer, but when I drop the application to another computer, it gives the following error "I could not find the connection line in "CarAccountingEntities" in the application configuration file." What could be the problem? Sorry for the bad English, I used a translator

Here is my ConnectionStrings in App.config:

<connectionStrings>
    <add name="CarAccountingEntities" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\CarAccounting.mdf;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

You mention that the database is local in your computer, when you move the application to another computer, you most probably did not move the old database or create a new database in the other computer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM