ASP.NET MVC 3 - Unable to find the requested .Net Framework Data Provider

前端 未结 13 1228
名媛妹妹
名媛妹妹 2020-12-24 01:37

Background-info:

I\'m using Microsoft Visual Web Developer 2010 Express.
Info about my (lack of) experience: the problem occured with

相关标签:
13条回答
  • 2020-12-24 02:28

    You need to install Microsoft SQL Server Compact 4.0.

    0 讨论(0)
  • 2020-12-24 02:28

    What I did was in order to overcome the first problem I put in Web.config the code:

     <add name="MovieDBContext"
         connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Movies.sdf;Integrated Security=True"
       providerName="System.Data.SqlClient"/>
    

    Notice I am creating SQL CE 4 database, therefore the .sdf and not .mdf

    Next, you should receive another connection errors on the page /Movies, so replace the above code with :

    <add name="MovieDBContext"
         connectionString="Data Source=|DataDirectory|\Movies.sdf;"
       providerName="System.Data.SqlServerCe.4.0"  />
    

    And you should be fine.

    0 讨论(0)
  • 2020-12-24 02:29

    I was having the same problem so I replaced

    <add name="MovieDBContext"     connectionString="Data Source=|DataDirectory|Movies.sdf"
    providerName="System.Data.SqlServerCe.4.0"/>
    

    with the following

    <add name="MovieDBContext"
         connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;database=Movies;User ID=sa;password="
         providerName="System.Data.SqlClient"/>
    

    And it worked enough to let me continue working. I too would also eventually learn how to make these kinds of applications work with mysql at some point, but for now this should at least help you continue with the tutorial.

    0 讨论(0)
  • 2020-12-24 02:30

    This worked for me, hope it helps

    <add name="MovieDBContext"
         connectionString="Data Source=(local);Initial Catalog=Movies; Integrated Security=true;"    providerName="System.Data.SqlClient" />
    </connectionStrings>
    
    0 讨论(0)
  • 2020-12-24 02:31

    I had a server. It ran windows updates. And a message waiting for restart was open. After restart it worked again.

    0 讨论(0)
  • 2020-12-24 02:33

    I changed my SQL providerName="System.Data.SqlClient" in web.config , since I have SQL client as well as SQL compact installed on my system.

    0 讨论(0)
提交回复
热议问题