Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net Azure网站在更改架构后无法识别我的数据库表_Asp.net_Azure_Azure Sql Database_Azure Mobile Services_Azure Web Roles - Fatal编程技术网

Asp.net Azure网站在更改架构后无法识别我的数据库表

Asp.net Azure网站在更改架构后无法识别我的数据库表,asp.net,azure,azure-sql-database,azure-mobile-services,azure-web-roles,Asp.net,Azure,Azure Sql Database,Azure Mobile Services,Azure Web Roles,我有一个Microsoft Azure网站运行并使用Azure SQL数据库,其唯一目的是存储和检索用户帐户。然而,根据许多在线教程,我也需要一个移动客户端,例如,我必须将数据库表的“schema”从“dbo”更改为我的移动服务的名称,即“usermobileservice” 这是使用SQL查询完成的: CREATE SCHEMA usermobileservice; ALTER SCHEMA usermobileserviceTRANSFER dbo.usertable; 这样做的诀窍,我能

我有一个Microsoft Azure网站运行并使用Azure SQL数据库,其唯一目的是存储和检索用户帐户。然而,根据许多在线教程,我也需要一个移动客户端,例如,我必须将数据库表的“schema”从“dbo”更改为我的移动服务的名称,即“usermobileservice”

这是使用SQL查询完成的:

CREATE SCHEMA usermobileservice;
ALTER SCHEMA usermobileserviceTRANSFER dbo.usertable;
这样做的诀窍,我能够连接到数据库使用我的移动应用程序,但现在我不能访问数据库使用我的Azure网站!给我这个错误:

Server Error in '/' Application.

Invalid object name 'UserTable'.

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. 

Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'UserTable'.

我相信ASP.NET Web应用程序无法再找到数据库表,因为我更改了模式?在网站和移动服务之间共享数据的正确方式是什么?

对于存在相同问题的用户,只需将调用模式更改表的SQL查询替换为以下内容:

您的移动服务名称。您的表格名称

就我而言:

usermobileservice.UserTable

例如:

SELECT * FROM usermobileservice.UserTable

感谢@Brendan Green为您指路

这是因为您更改了架构。您需要更新web应用程序查询以使用usermobileservice.UserTable,或者创建一个将usermobileservice作为默认架构的SQL帐户,并更新连接字符串以使用此用户。噢,伙计!这解释了很多。由于创建一个全新的SQL是一件麻烦事,我该如何更新Web应用程序查询@布伦丹格林