0

I create a project to display a list of student on Database (the current.net framework version is 4.6.1). The wizard ask me to add database to the project and I accept it. enter image description here

When I build the project on Debug mode, everything works fine on Windows 10. enter image description here

I copy the debug folder to windows 7 and try to run the project, it shows me the error message. enter image description here

System.Data.EntityException: The underlying provider failed on Open.

I try to install the .net framework 4.6.1 for windows 7 but it didn't work. This is the list of installed programs on windows 7: enter image description here

The list of installed programs on windows 10: enter image description here

enter image description here

I really don't know why my project didn't work on windows 7, are there some missing files or frameworks?

Thanks for your reading :D

3
  • There's no localdb in SQL 2008. Commented Sep 18, 2017 at 19:49
  • I think the project can run alone without SQL server. It just depends on .net framework? Commented Sep 19, 2017 at 1:10
  • Windows 7 seems not working with SQL Local Database 2014. I installed SQL 2012 Express Local Database and it worked! Commented Sep 21, 2017 at 4:21

1 Answer 1

1

"...LocalDB is a feature of SQL Server Express targeted to developers." You can use LocalDB on your development machine, but don't expect it to be working on other machine. I can't tell you an exact solution as it depends on what you are allowed to do. Moving to a "real" database maybe.

Sign up to request clarification or add additional context in comments.

5 Comments

I tried to use the original database by modifying the connection string in App.config (point to C:\TestDatabase.mdf). Then I copy all of them to same location in windows 7, but it still show the error.
I think, this is because LocalDB (SQL Express) isn't installed on the Win 7 machine. Could you please post the original and the modified connection string?
This is the created connection string when I attached database to my project: <connectionStrings> <add name="DemoDatabaseEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=(LocalDB)\MSSQLLocalDB;attachdbfilename=|DataDirectory|\DemoDatabase.mdf;integrated security=True;connect timeout=30;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient"/> </connectionStrings>
That means the SQL Express is required on windows 7?
Sure. It contains LocalDB. Also would worth figuring out where |DataDirectory| points, but a simple google search did not yield and usable results for me and i'm on a run.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.