Saif Khan
Saif Khan

Reputation: 18792

Subsonic 3.0 with winform app

Can subsonic 3.0 be used with a winform app? Do I need to add any references to the system.web?

If it can be done, how can I exclude certain tables in the DB? Can I use the following whih I am using for subsonic 2.0

<providers>
  <!--<clear/>-->
  <add name="TEST" type="SubSonic.SqlDataProvider, SubSonic" connectionStringName="myString" includeTableList="CustomerReference" includeProcedureList=""/>
</providers>

Upvotes: 0

Views: 170

Answers (1)

Diego
Diego

Reputation: 682

You can use it!. There is no need to include System.web. But you lose the scaffolding tools (except that you make a web application specifically to use the tools and share a DB with the desktop app). And for excluding tables, you have to modify Settings.ttinclude, in the following section (line 30) in Settings.ttinclude:

//this is a list of tables you don't want generated
string[] ExcludeTables = new string[]{
"sysdiagrams",
"BuildVersion",
};

I never used Subsonic 2, buth I think that the XML definitions for the data providers are a little different.

For example, this is what I'm using:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <connectionStrings>
   <!-- SQLite -->
    <add name="Test"
         providerName="System.Data.SQLite"
         connectionString="Data Source = C:\Database.db;Version=3"/>
  </connectionStrings>
</configuration> in

Upvotes: 1

Related Questions