简体   繁体   English

在Azure上添加新表

[英]Add new table on Azure

Can anyone explain me what is the exact procedure to add a new table on an Azure database? 谁能向我解释在Azure数据库上添加新表的确切过程是什么? I'm literally going crazy!!! 我真的快要疯了!!! I download the sample project from Azure for backend mobile and forms application, but I can't add new table in any way. 我从Azure下载用于后端移动和表单应用程序的示例项目,但是我无法以任何方式添加新表。 Every change I made, I have exception (internal server error). 我所做的每一个更改都有例外(内部服务器错误)。 I create a new data object MyClass:EntityData and create a Controller in the appropriate procedure. 我创建一个新的数据对象MyClass:EntityData并在适当的过程中创建一个Controller。 I've also added a Dbset reference in database context. 我还在数据库上下文中添加了Dbset参考。 Not Work. 不行。

There are two different versions of this question: 此问题有两种不同的版本:

  1. "I am using a Node.js Backend - how do I create a table?" “我正在使用Node.js后端-如何创建表?” - Answer - define the table in your node code in the tables directory - it will be created for you. -回答-在表目录中的节点代码中定义表-它将为您创建。
  2. "I am using an ASP.NET Backend - how do I create a table?" “我正在使用ASP.NET后端-如何创建表?” - Answer - this is an Entity Framework problem. -答案-这是一个实体框架问题。 Create an EF Migration to create the database and apply the migration when you upload the code. 创建EF迁移以创建数据库并在上载代码时应用迁移。

References: 参考文献:

Since you've tagged Visual Studio, just use SSDT (SQL Server Data Tools), connect to your Azure database and create a new table. 由于已标记Visual Studio,因此只需使用SSDT(SQL Server数据工具),连接到Azure数据库并创建一个新表。 It's no different than creating a local SQL Server table. 这与创建本地SQL Server表没有什么不同。

You could also create a CREATE TABLE script and execute it against your Azure database. 您还可以创建一个CREATE TABLE脚本,然后对您的Azure数据库执行它。 You could also use the schema synchronization feature within SSDT to compare a local copy of the table and synch it with your Azure DB. 您还可以使用SSDT中的架构同步功能来比较表的本地副本,并将其与Azure DB同步。

I followed the whole procedure for .net backend, but damn it! 我遵循了.net后端的整个过程,但是该死! still Invalid sync operation: The resource you are looking for has been removed, had its name changed, or is temporarily unavailable. 仍然无效的同步操作:您要查找的资源已被删除,名称已更改或暂时不可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM