tags:

views:

273

answers:

1

I cannot get the latest SubSonic with SQLite ActiveRecord to work.

I grabbed the latest 3.0x bits from the web site on July 15th.
I made a brand new WPF project with the namespace 'MineSpace'.
I created a SQLite v3 database with 5 tables and FKey relationships (no triggers).
I added ActiveRecord.tt, Settings.ttinclude, SQLite.ttinclude to the project.
I updated my app.config (this is for a WPF app) with
   a. configSection for SubSonicService
   b. DbProviderFactories for my "SQLiteDataProvider".
   c. connectionsStrings added "Conn01"
   d. Added SubSonicService section with defaultProvider of "SQLiteDataProvider"
   e. Set the complete absolute path to my .db file.
Edited Settings.ttinclude with
   a. Namespace = "MineSpace"
   b. ConnectionStringName "Conn01"
   c. Databasename = "CoreInfo"


Right-click on ActiveRecord.tt and do 'run custom tool', and...

1 Warning: "Multiple template directives were found in the template. All but the first one will be ignored. Multiple parameters to the template directive should be specified within one template directive." in file 'Settings.ttinclude'



Right-click on the project do 'rebuild', and...

6 errors, here is a sample -
The type or namespace name 'CoreInfoDB' does not exist in the namespace 'MineSpace' (are you missign an assembly reference?)

7 warnings, here is a sample -
'MineSpace.EmailAddrs' overrides Object.Equals(object o) but does not override Object.GetHashCode()


A: 

You also need to add and then 'run custom tool' on the files Structs.tt and Context.tt

Adam
Sold! Those steps were definitely missing. I added those files, and now I get good generation and build. The 'readme' could use some work because it assumed I knew a lot of stuff I didn't (getting as far as I did took some trial and error). Here's to hoping the docs and HOWTO type pages get more verbose. :)<pre>Open up _Settings.ttSet the Namespace, ConnectionString, and DatabaseName accordinglySave.Drag into project in VS 2008.You're done.If you have other DB (SQLite or MySQL) use the appropriate file in TemplateProviders directory.</pre>That's not quite enough.
ScSub
I'm pretty sure you can edit the docs yourself, and add more info, if you sign up. I'm also pretty sure Rob would really appreciate it. It's definitely worth you getting on github and helping with the readme too.
Adam
I'd love some help - specifically what you didn't understand. Also - if you're willing to help *us* yes, I'd love to have you update the README (even though no one reads it anyway :):)
Rob Conery