views:

108

answers:

1

I'm using the SubSonic scaffold control with auto-generating many to many controls.

<subsonic:Scaffold ID="scfMain" runat="server"
    AutoGenerateManyToMany="true"></subsonic:Scaffold>

On Page_Load I'm setting the table name

scfMain.TableName = "Foo";

The many to many controls are generated by a many to many table, two foreign keys, two primary keys. This works initially, but after a while the many to many controls disappear. The only way to get them back is to restart the app somehow, either by changing the web config, recycling the app pool, or restarting the site.

Is this a known bug, or is there something I'm doing wrong? I'm seeing the same thing on my local machine, staging, and production, so it doesn't seem to be unique to one environment.

A: 

The many to many controls are generated by a many to many table, two foreign keys, two primary keys

Does that mean you have two primary keys in your many to many table? SubSonic does not support multiple primary keys in one table.

sparks
If I don't give it two primary keys, autogeneratemanytomany doesn't work.
Michael Pardo
I don't have experience with scaffolding in SubSonic, but what if you made the two primary key columns a unique pair, create a new column, and make that new column the primary key? Does that worK?
sparks