l******9 发帖数: 579 | 1 【 以下文字转载自 JobHunting 讨论区 】
发信人: light009 (light009), 信区: JobHunting
标 题: error .mdf file unable to attach in Visual Studio 2013 win 7
发信站: BBS 未名空间站 (Mon Feb 16 19:26:34 2015, 美东)
I am working on RESTful Web services design in Visual Studio 2013 on Windows
7.
I need to run the command of Update-Database to create the database in code-
first migrations in a project.
But I get an error:
System.Data.SqlClient.SqlException : Cannot attach the file 'C:MyPathApp
_DataProductReview_newContext-20150216131927.mdf' as database 'ProductReview
_newContext-20150216131927'.
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(
DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean
allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions
, DbConnectionInternal& connection)
Thanks ! | c*****d 发帖数: 6045 | 2 这个目的是要attach mdf到sql server数据库? | l******9 发帖数: 579 | 3 I need to attach it to a local sql server.
Any help would be appreciated.
【在 c*****d 的大作中提到】 : 这个目的是要attach mdf到sql server数据库?
| c*****d 发帖数: 6045 | 4 看error message是不能attach *.mdf到sql server
有很多原因,比如版本不兼容,数据库连接的configuration,或者用户验证有问题
最简单的方法不要用visual studio
直接在sql server management studio里面直接attach
如果不能attach看错误信息是什么
【在 l******9 的大作中提到】 : I need to attach it to a local sql server. : Any help would be appreciated.
|
|