tags:

views:

226

answers:

3

Are there any restrictions on the names of tables, or issues with certain names when working with SubSonic? I have table called 'Activity' and SubSonic doesn't seem to recognise it. When it was called 'Activities' it worked fine.

Basically I am wanting to go with singular table names as a convention (and the other conventions as detailed in the SubSonic Conventions blog post) and added fixPluralClassNames="false" to the web.config (because I have a table called 'Focus', which SubSonic kept naming 'Focu')

A: 

Generally, reserved words in C# are not allowed as table names. I'm not sure why Activity would be a problem though. The first thing to check when a table is not generated is that the table has a primary key.

ranomore
It has a primary key, as it was previously called Activities and it worked then
Sam
A: 

One common problem that I ran into was it would not work if my tables begin with special characters or numbers. Changing that fixed it on my end. Apart from that I did not run into any other issues.

CodeToGlory
A: 

Clearing files in the Temporary ASP.NET Files folder (After closing Visual Studio), or changing the .abp file seems to be a valid fix to this.

Sam