无效的对象名称dbo.TableName [英] Invalid object name dbo.TableName

查看:196
本文介绍了无效的对象名称dbo.TableName的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里收到以下错误: http://mvcbense.azurewebsites.net/

I am getting the following error here: http://mvcbense.azurewebsites.net/


无效的对象名称'dbo.BlogPosts'。

Invalid object name 'dbo.BlogPosts'.

这是一个使用实体框架代码的MVC3应用程序。我已经在其他地方看过,只是发现了一些关于改变模式的东西,我认为是 dbo。

This is an MVC3 application using Entity Framework Code First. I have looked elsewhere and have only found something about changing the schema which I assume is what dbo. is.

我对EF很新,但是看起来好像EF为我创造了这些,所以我不确定该怎么做。查看我的本地SQL Server Express,所有表都有 dbo。模式。为什么我可以在本地运行,但不能发布到Azure?

I am fairly new to EF, but it would look as if EF creates these for me, so I am unsure of what to do. Looking in my local SQL Server Express, all the tables have the dbo. schema on them. Why would I be able to run them locally but not published to Azure?

谢谢

推荐答案

问题是您尚未正确配置SQL Azure以先迁移基于SQL Express的架构。当您创建基于本地SQL Server的ASP.NET Windows Azure网站时,首先必须手动将配置的内部数据库数据库迁移到SQL Azure,然后将ASP.NET应用程序发布到Windows Azure网站。如果您不会这样做,您的ASP.NET网站将无法正常工作。

The problem is that you haven't configured SQL Azure correctly to migrate your SQL Express based schema first. When you create an ASP.NET Windows Azure Website which is based on local SQL Server, you would have to manually migrate the on-premise DB configured to SQL Azure first and then publish your ASP.NET application to Windows Azure Website. IF you will not do it, your ASP.NET website will not work.

根据异常,缺少初始DB表,所以您需要的是从下面的列表中选择任何适当的数据库迁移方法,以首先迁移DB然后运行您的Windows Azure网站:

Based on the exception the initial DB tables are missing so what is needed for you is to select any of the suitable database migration method from the list below to migrate your DB first and then run your Windows Azure Website:

将数据库迁移到Windows Azure SQL数据库(以前称为SQL Azure)

这篇关于无效的对象名称dbo.TableName的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆