支架动态数据页面上缺少表格

发布于 2024-09-03 08:16:21 字数 433 浏览 2 评论 0原文

我第一次创建了 Linq-to-SQL DBML。我将所有表格拖放到设计师那里。这些表全部出现在 Designer.cs 文件中。在 Global.asax 中,我还有 model.RegisterContext() 和 ScaffoldAllTables = true 选项。路线也已设置。

我可以打开“脚手架”页面,但至少缺少一张我试图显示的表格。这个缺失的表与引用它的子表有关系。子表出现。查看子表的数据时,引用缺失/父表的列显示数字 PK int 值,而不是显示“名称”。因此,它不是显示“汽车”,而是显示 1,而不是显示“飞机”,而是显示 2,等等。

数据库中还有另一个表,其结构类型与缺失的表相同,并且它正确地出现在脚手架中表。

对于这个缺失的表,我尝试显式添加 ScaffoldTable 属性但无济于事。

有谁知道什么会导致这样的表格不会出现在脚手架表格列表中?非常感谢。

I created a Linq-to-SQL DBML for the first time. I dragged and dropped all my tables over to the designer. The tables all appear in the designer.cs file. In Global.asax, I also have model.RegisterContext() with the ScaffoldAllTables = true option. The routes are also setup.

I can pull up the Scaffolding page, but there's at least one table that is missing that I'm trying to get to show up. This missing table has a relationship with a child table that references it. The child table appears. When viewing data for the child table, the column that references the missing/parent table shows the numeric PK int value, rather than showing the "name". So instead of showing "Cars" it shows 1, and instead of showing "Planes" it shows 2, etc.

There's another table in the DB that has the same type of structure as the missing table, and it is correctly appearing in the scaffolded tables.

For this missing table, I've tried explicitly adding the ScaffoldTable attribute to no avail.

Does anyone know what would cause a table like this to not appear in the list Scaffolded tables? Thanks very much.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

习惯成性 2024-09-10 08:16:21

我成功了。我最终创建了一个新的动态数据网站并从头开始。然后所有的桌子都出现了。对于我遇到问题的项目,这实际上是我试图修改的其他人创建的现有项目。我回到那个项目并尽可能删除,看看是什么导致我的表格不出现。但这效果并不好,因为在我删除了太多内容后项目停止了编译。确实没有时间去弄清楚。新项目正在运作。

有趣的是,在旧项目中,如果我从 DBML 中删除所有表,然后仅添加回其中 1 个表,则支架中会出现完全相同的 15 个左右表集。显然,我要添加到 DBML 中的任何内容都被完全忽略了。它可能是一个我没有源代码的 DLL,它优先于我正在做的事情。

I got it working. I ended up creating a new Dynamic Data website and started from scratch. Then all the tables appeared. With the project I was having problems with, this was actually an existing project someone else created that I was attempting to modify. I went back to that project and deleted as much as I could to see what was causing my tables to not appear. But this didn't work out well since the project stopped compiling after I deleted too much. Don't really have the time to figure that out. The new project is working.

Interestingly, on the old project, if I deleted all the tables from the DBML, and added back just 1 of them, the same exact set of 15 or so tables appeared in the scaffold. So apparently whatever I would add to the DBML was completely ignored. It may have been a DLL that I don't have the source for that was taking precedence over what I was doing.

九局 2024-09-10 08:16:21

表的名称是什么?因为这可能是问题所在,即它是像 Type 这样的保留字吗?

what is the name of the table? as this could be the issue, i.e. is it a reserved word like Type?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文