我下载了一个开源的MVC项目,我无法运行它.作者在备忘录中提到我应该将数据库所有者更改为自己.但我不知道该怎么做.我无法在SQL服务器对象资源管理器中看到数据库.
EntityFramework.dll中发生了'System.Data.Entity.Core.ProviderIncompatibleException'类型的异常,但未在用户代码中处理
附加信息:访问数据库时出错.这通常意味着与数据库的连接失败.检查连接字符串是否正确,以及是否使用了相应的DbContext构造函数来指定它或在应用程序的配置文件中找到它.
有关DbContext和连接的信息,请参阅http://go.microsoft.com/fwlink/?LinkId=386386.有关失败的详细信息,请参阅内部异常.
错误指向此处
public override TEntity ReadOne(ISpecification<TEntity> spec) {
return this.set.Where(spec.IsSatisfied).FirstOrDefault();
}
Run Code Online (Sandbox Code Playgroud)
web.config:
<connectionStrings>
<add name="mvcForum.DataProvider.MainDB" connectionString="Data Source=SERVERNAMEorSERVERNAME\INSTANCE;Initial Catalog=DBNAME;User ID=USER;password=PASSWORD"/>
<!--add name="mvcForum.DataProvider.MainDB" connectionString="Data Source=.\SQL2008r2Express;Initial Catalog=mvcforum;User ID=test;password=test;" providerName="System.Data.SqlClient" />-->
<!--<add name="User.MongoDB" connectionString="mongodb://localhost/mvcforum" />-->
</connectionStrings>
Run Code Online (Sandbox Code Playgroud) 家伙.我正在研究一个开源的MVC项目.但建成后(通过).我得到了运行时错误.
Server Error in '/' Application.
The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where …Run Code Online (Sandbox Code Playgroud) 如果我有
vector<int> vec { 1, 2, 3, 4}
Run Code Online (Sandbox Code Playgroud)
如何使用
的std ::反向
把它变成
vec {2,1,3,4}