6
Reply

How to correct the error below ?

Ask a question
Tangara G

Tangara G

8y
386
1
  1.   
  2. Server Error in '/' Application.  
  3. A file activation error occurred. The physical file name '[DataDirectory]\Firma.mdf' may be incorrect. Diagnose and correct additional errors, and retry the operation.  
  4. CREATE DATABASE failed. Some file names listed could not be created. Check related errors.  
  5. 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 it originated in the code.  
  6.   
  7. Exception Details: System.Data.SqlClient.SqlException: A file activation error occurred. The physical file name '[DataDirectory]\Firma.mdf' may be incorrect. Diagnose and correct additional errors, and retry the operation.  
  8. CREATE DATABASE failed. Some file names listed could not be created. Check related errors.  
  9.   
  10. Source Error:  
  11.   
  12.   
  13. Line 16:         public ActionResult Index()  
  14. Line 17:         {  
  15. Line 18:             var employee = db.Employees.ToList();  
  16. Line 19:   
  17. Line 20:             return View(employee);  
  18.   
  19.   
  20. Source File: c:\Users\Karen Goh\Documents\Visual Studio 2013\Projects\Company\Company\Controllers\TitleController.cs    Line: 18  
  21.   
  22. Stack Trace:  
  23.   
  24.   
  25. [SqlException (0x80131904): A file activation error occurred. The physical file name '[DataDirectory]\Firma.mdf' may be incorrect. Diagnose and correct additional errors, and retry the operation.  
  26. CREATE DATABASE failed. Some file names listed could not be created. Check related errors.]  
  27.    System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2435274  
  28.    System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +5736940  
  29.    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285  
  30.    System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +3731  
  31.    System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite) +940  
  32.    System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite) +272  
  33.    System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +280  
  34.    System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.<NonQuery>b__0(DbCommand t, DbCommandInterceptionContext`1 c) +10  
  35.    System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch(TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) +72  
  36.    System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.NonQuery(DbCommand command, DbCommandInterceptionContext interceptionContext) +356  
  37.    System.Data.Entity.SqlServer.<>c__DisplayClass1a.<CreateDatabaseFromScript>b__19(DbConnection conn) +119  
  38.    System.Data.Entity.SqlServer.<>c__DisplayClass33.<UsingConnection>b__32() +443  
  39.    System.Data.Entity.SqlServer.<>c__DisplayClass1.<Execute>b__0() +10  
  40.    System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Func`1 operation) +189  
  41.    System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute(Action operation) +78  
  42.    System.Data.Entity.SqlServer.SqlProviderServices.UsingConnection(DbConnection sqlConnection, Action`1 act) +175  
  43.    System.Data.Entity.SqlServer.SqlProviderServices.UsingMasterConnection(DbConnection sqlConnection, Action`1 act) +556  
  44.    System.Data.Entity.SqlServer.SqlProviderServices.CreateDatabaseFromScript(Nullable`1 commandTimeout, DbConnection sqlConnection, String createDatabaseScript) +86  
  45.    System.Data.Entity.SqlServer.SqlProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection) +164  
  46.    System.Data.Entity.Core.Common.DbProviderServices.CreateDatabase(DbConnection connection, Nullable`1 commandTimeout, StoreItemCollection storeItemCollection) +76  
  47.    System.Data.Entity.Core.Objects.ObjectContext.CreateDatabase() +134  
  48.    System.Data.Entity.Migrations.Utilities.DatabaseCreator.Create(DbConnection connection) +119  
  49.    System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase) +142  
  50.    System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration) +78  
  51.    System.Data.Entity.Internal.DatabaseCreator.CreateDatabase(InternalContext internalContext, Func`3 createMigrator, ObjectContext objectContext) +89  
  52.    System.Data.Entity.Internal.InternalContext.CreateDatabase(ObjectContext objectContext, DatabaseExistenceState existenceState) +116  
  53.    System.Data.Entity.Database.Create(DatabaseExistenceState existenceState) +218  
  54.    System.Data.Entity.DropCreateDatabaseIfModelChanges`1.InitializeDatabase(TContext context) +181  
  55.    System.Data.Entity.Internal.<>c__DisplayClassf`1.<CreateInitializationAction>b__e() +76  
  56.    System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +60  
  57.    System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +357  
  58.    System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c) +7  
  59.    System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +110  
  60.    System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +198  
  61.    System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase() +73  
  62.    System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +28  
  63.    System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +53  
  64.    System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator() +15  
  65.    System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator() +53  
  66.    System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +369  
  67.    System.Linq.Enumerable.ToList(IEnumerable`1 source) +58  
  68.    Company.Controllers.TitleController.Index() in c:\Users\Karen Goh Seow Hui\Documents\Visual Studio 2013\Projects\Company\Company\Controllers\TitleController.cs:18  
  69.    lambda_method(Closure , ControllerBase , Object[] ) +62  
  70.    System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14  
  71.    System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +157  
  72.    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27  
  73.    System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +22  
  74.    System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +29  
  75.    System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49  
  76.    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32  
  77.    System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50  
  78.    System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225  
  79.    System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10  
  80.    System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10  
  81.    System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49  
  82.    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34  
  83.    System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26  
  84.    System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100  
  85.    System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10  
  86.    System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49  
  87.    System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27  
  88.    System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13  
  89.    System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29  
  90.    System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49  
  91.    System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36  
  92.    System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12  
  93.    System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +22  
  94.    System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49  
  95.    System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26  
  96.    System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10  
  97.    System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21  
  98.    System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +29  
  99.    System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49  
  100.    System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28  
  101.    System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9  
  102.    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9644097  
  103.    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155  
  104.   
  105.   
  106. Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055

  107. .0  
  108.                                                                                       

Answers (6)