views:

63

answers:

2

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.

A: 

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

Wizzard
Good point. The name of the table is "amounts". I'm going to try and re-create this DBML in a new project. I'm actually doing this in an existing project that was once scaffolded before.
Ben Amada
A: 

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.

Ben Amada