views:

306

answers:

3

I downloaded and installed the SubSonic MVC templates. I'm able to create a new project from this template and the 'prewritten' views work fine. I'm able to edit records from the Artist table of the included 'Chinook' database.

So now I'd like to get this to work with MY database. Here's what I've done.

  1. Changed to connectionstring in the Web.Config to point to my DB running on a local copy of SQL 2008.
  2. Updated the _Settings.tt file to reflect the above connection
  3. rerun the each of the tt files by right clicking and selecting 'run custom tool'

** when I do this all the cs files is are empty. No errors just empty files **

To be sure I've removed the Referance to SubSonic and readded it with no help.

Have I missed something? Can anyone tell me what I'm doing wrong?

+1  A: 

The Error List should show what's happening when you try to run the custom tool and you get nothing. Do you see any errors listed there?

John Sheehan
I get this warning...Warning 1 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. C:\mcb\work\projects\SubSonic_TEST\SubSonicMVCDemo\SubSonicMVCDemo\Models\_Settings.tt 1 4 SubSonicMVCDemoI dont understand what this means The first line reads <#@ template language="C#v3.5" debug="True" hostspecific="True" #>That is the only 'template I can find. I have changed nothing except what I mention in my question I'm using these right out of the box.
Mark Buckley
+1  A: 

Do the tables in your database have Primary Keys? This is a required convention for SS ActiveRecord.

kevinw
I thought that maybe this was a problem so I went and checked. There were two tables out of 15 that did not have Primary keys. I updated those two table and re ran the templates with the same result.
Mark Buckley
A: 

I finally got this to at least build with out errors. I had some database connectivity issues which were causing my initial problems, however after that I still could not build successfully. I was getting a bunch of referance errors. I had to change the code.

DataProvider.Tables.Add

had to be changed to

DataProvider.Schema.Tables.Add

in the Context.cs file

So for now it Builds but I haven't gone any further yet.

-MARK-

Mark Buckley