Michal
Michal

Reputation:

SubSonic configuration - how to ignore certain tables

In the database I have about 150 tables - most of them from previous versions of the application I currently work on. For my app I only need about 20 tables - is there a way to ignore some of the tables by setting some parameter in web.config?

Upvotes: 2

Views: 1248

Answers (2)

TheVillageIdiot
TheVillageIdiot

Reputation: 40497

suppose you have tables with names Table1, Table2, Table3 and you want to use only Table1 and Table3

You can use excludeTableList or includeTableList attributes to control this.

includeTableList

<add name="YourProvider" type="SubSonic.SqlDataProvider, SubSonic" 
 connectionStringName="YourConnection" 
 generatedNamespace="YourNamespace" includeTableList="Table1, Table3"/>

excludeTableList

<add name="YourProvider" type="SubSonic.SqlDataProvider, SubSonic" 
 connectionStringName="YourConnection" 
 generatedNamespace="YourNamespace" excludeTableList="Table2"/>

Usually if you have few table to include you will use includeTableList so you have to type fewer names. You can also use * wildcard like this includeTableList="Table*" />

viewStartsWith

if your view starts with vw_ you can add following option:

viewStartsWith="vw_"

Upvotes: 4

cbp
cbp

Reputation: 25628

Yes, you can use excludeTableList: see here

Upvotes: 0

Related Questions