Visual Studio 2012 添加数据库并创建第一个名为 users 的表 [英] Visual Studio 2012 adding a database and creating first table named users
问题描述
我有 Visual Studio 2012 Express 并设置了一个 razor c#.net 项目.
I have Visual Studio 2012 Express and have a razor c#.net project set up.
我已右键单击 AppData 并添加了一个 Microsoft SQL 数据库并将其命名为EspressoCoffees"
I have right clicked on AppData and added a Microsoft SQL database and named it "EspressoCoffees"
现在我可以看到它在那里,我转到数据库资源管理器并右键单击表并单击添加表.
Now I can see that it is there, I goto the Database Explorer and right click on Tables and click add table.
表格设计者出现,我制作了几列以确保Id"仍然是主键.
The table designer comes up and I make a few columns making sure "Id" remains primary key.
- 我到底应该在哪里命名这张桌子?有一个表格属性面板,我无法在其中编辑名称,因为它是灰色的?
- 当我保存表格时,它让我选择文件的位置,这是什么文件?表还是数据库???
- 如果我将 SQL 文件保存在应用数据部分...它不会以任何方式出现在 Tables 文件夹下.
推荐答案
只需在生成的 T-SQL 中修改表的名称,然后单击更新"按钮(位于选项卡的左上角).
Just modify the name of the table in the generated T-SQL and click on the "Update" button (int the top-left corner of the tab).
这篇关于Visual Studio 2012 添加数据库并创建第一个名为 users 的表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!