2012-03-13 11 views
0

私はasp.net mvc 3を使用してサイトを開発し、最初にefコードを使用してデータベースを生成しました。 scaffoldingは、コンパイルされたSQLコンパクトデータベースを使用してローカルマシン上で正常に動作します。それから私はホスティング会社にワンクリックでWebを展開し、私は以下のエラーが出始めた。この問題が発生した場合は、事前にアドバイスをお願いします。無効なオブジェクト名dbo.MenuItems

[SqlException (0x80131904): Invalid object name 'dbo.MenuItems'.] 
    System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +404 
    System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() +412 
    System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1363 
    System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +59 
    System.Data.SqlClient.SqlDataReader.get_MetaData() +118 
    System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6387873 
    System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +6389442 
    System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +538 
    System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +28 
    System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +256 
    System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +19 
    System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) +553 

[EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details.] 
    System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) +10646103 
    System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute(ObjectContext context, ObjectParameterCollection parameterValues) +11488485 
    System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +11120473 
    System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +47 
    System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +382 
    System.Linq.Enumerable.ToList(IEnumerable`1 source) +80 
    Bonappetit.Controllers.MenuItemsController.Index() in c:\Bonappetit\Bonappetit\Controllers\MenuItemsController.cs:21 
    lambda_method(Closure , ControllerBase , Object[]) +79 
    System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +264 
    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39 
    System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +129 
    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +826266 
    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +314 
    System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +825488 
    System.Web.Mvc.Controller.ExecuteCore() +159 
    System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +335 
    System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62 
    System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20 
    System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +54 
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +469 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375 

答えて

0

あなたのコードは、あなたの)あなたのテーブルがサーバ

2に/下盛作成されていない)

考えられる理由

1に存在しないオブジェクトにアクセスしようとしています正しいデータベースに接続されていません。

これら2つを確認してください。さらに進めるには、良い形になります。

+0

私は正しいデータベースに接続しているので、オプション(1)でなければならないと確信しています。展開を行ってもホストサーバーのデータベースは空です。データとスキーマをコピーするための公開設定を構成しました私のローカルデータベースからホストデータベースに..しかし、私はホストデータベースをチェックしたとき、それはまだ完全に空です..私はデータベースをホストするために手動でスキーマを移行すると思いますか?何がクリックしてウェブを展開するのですか? – user1261952

関連する問題