문제

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!

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top