Question

I went over to the subsonic website and downloaded the version 3.0.0.4. My project setup went well without errors. I then added the following to access two views in my DB

const string TABLE_SQL=@"SELECT *
    FROM  INFORMATION_SCHEMA.TABLES
    WHERE TABLE_TYPE='BASE TABLE'
    UNION
    SELECT TABLE_CATALOG,TABLE_SCHEMA,TABLE_NAME, 'View' TABLE_TYPE
    FROM INFORMATION_SCHEMA.VIEWS";

In Visual Studio 2010 I am seeing the views were generated, however when I do the following to test

MsgBox(Accounting.vwVendor.All().Count().ToString())

I get no data. If I run the same for other generated tables, it works fine. I do see the following in VS Immediate Window

A first chance exception of type 'System.InvalidOperationException' occurred in SubSonic.Core.dll

Am I missing something for accessing SQL Server views via SubSonic?

UPDATED: I changed the target framework from Framework 4.0 Client Profile to Framework 3.5 Client Profile, build the solution, changed back the target framework to 4.0, build the solution and it worked!

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top