2016-07-05 1 views
0

내 프로젝트는 새 프로젝트를 시작할 때 Visual Studio에서 제공하는 것 외에는 아무것도 사용하지 않고 간단하고 비어있는 asp.net 프로젝트 솔루션으로 구성됩니다.Asp.net 데이터베이스 업데이트

처음으로 개발을 돕기 위해 마이그레이션을 사용하고 있습니다. 지금까지 마이그레이션을 올바르게 수행하고 패키지 관리자 콘솔을 통해 초기 마이그레이션을 추가했습니다. 나는 패키지 관리자 콘솔에서 '업데이트를 데이터베이스'를 실행하여 내 데이터베이스를 업데이트 갈 때, 이제

<connectionStrings> 
    <add name="DefaultConnection" connectionString="Data Source=SYS-VIS-15\SQLEXPRESS;AttachDbFilename=|DataDirectory|\aspnet-GiggHub-20160704033906.mdf;Initial Catalog=aspnet-GiggHub-20160704033906;Integrated Security=True" providerName="System.Data.SqlClient" /> 
    </connectionStrings> 

: 내가 할 수있는 유일한 변화는이 같은 새로운 데이터 소스를보고 내의 Web.config를 수정한다 나는 다음과 같은 오류 얻을 : 내가 알고 있어요 내 모든 권한을 확인했습니다

Directory lookup for the file "C:\Users\Admin\Source\Workspaces\GigHub\GiggHub\GiggHub\App_Data\aspnet-GiggHub-20160704033906.mdf" failed with the operating system error 5(Access is denied.). CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

을,하지만 난 틱 또는을 선택 취소이 오류를 극복하기 위해 무엇을해야 볼 수 없습니다. 누구든지 무엇을 해야할지 압니까?

전체 파일 출력은 모두 다음입니다 : -> SQL 서버 개체 탐색기 -보기에서 Visual Studio를 클릭에서

Specify the '-Verbose' flag to view the SQL statements being applied to the target database. 
System.Data.SqlClient.SqlException (0x80131904): Directory lookup for the file "C:\Users\Admin\Source\Workspaces\GigHub\GiggHub\GiggHub\App_Data\aspnet-GiggHub-20160704033906.mdf" failed with the operating system error 5(Access is denied.). 
CREATE DATABASE failed. Some file names listed could not be created. Check related errors. 
    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) 
    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) 
    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) 
    at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) 
    at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) 
    at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) 
    at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() 
    at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<NonQuery>b__0(DbCommand t, DbCommandInterceptionContext`1 c) 
    at System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) 
    at System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext) 
    at System.Data.Entity.SqlServer.SqlProviderServices.<>c__DisplayClass1a.<CreateDatabaseFromScript>b__19(DbConnection conn) 
    at System.Data.Entity.SqlServer.SqlProviderServices.<>c__DisplayClass33.<UsingConnection>b__32() 
    at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.<>c__DisplayClass1.<Execute>b__0() 
    at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func`1 operation) 
    at System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation) 
    at System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action`1 act) 
    at System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action`1 act) 
    at System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable`1 commandTimeout, DbConnection sqlConnection, String createDatabaseScript) 
    at System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection) 
    at System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection) 
    at System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase() 
    at System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection) 
    at System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase) 
    at System.Data.Entity.Migrations.Infrastructure.MigratorBase.EnsureDatabaseExists(Action mustSucceedToKeepDatabase) 
    at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration) 
    at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update(String targetMigration) 
    at System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.Run() 
    at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate) 
    at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate) 
    at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner) 
    at System.Data.Entity.Migrations.Design.ToolingFacade.Update(String targetMigration, Boolean force) 
    at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0() 
    at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command) 
ClientConnectionId:9b2f396d-dadf-4d0b-a334-1197e86beed1 
Error Number:5133,State:1,Class:16 
+0

당신이 관리 스튜디오를 사용하여 데이터베이스에 연결할 수있는 질문이? – Hakunamatata

+0

분석 할 코드를 제공하여 ur 질문에 답변 할 수 있습니다. –

+0

SSMS 만 설치했다는 말은 데이터베이스 엔진이 설치되어 있지 않다는 뜻입니까? 또한 '데이터베이스에서'라고 말하면 EF 디자이너의 엔티티 모델을 의미합니까? –

답변

0

확장>SQL은 (localdb)에서 표시되지 않습니다 node.If 서버 그 목록은 당신이 그것을 설치하지 않았다는 것을 의미합니다. 지역의 DB를 설치하려면

this에 모습 SO

관련 문제