p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional ASP.NET 4 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=554)
-   -   CH 30-15: Could not load type 'NorthwindDataContext'. (http://p2p.wrox.com/showthread.php?t=90973)

EDGY September 13th, 2013 07:46 PM

CH 30-15: Could not load type 'NorthwindDataContext'.
 
Ch30-15 Listing: Dynamic Data Manager example
(Built on top of 30-8)

Error Message: Could not load type 'NorthwindDataContext'.

It Builds successfully/ No errors; 30-8,..12,13,14 work fine using the same Northwind.dbml file.

The Northwind.dbml properties show name= "NorthwindDataContext" ; but Content & entity namespace Are blank.
Properties header = NorthwindDataContext DataContext

The global.aspx file use "NorthwindDataContext" as in 30-9 listing.

Northwind.dbml file IS not in an App_Code folder, just in root...

Anybody got any Ideas ?

Thanks, Edgy

Code:

<body>
    <form id="form1" runat="server">
    <div>
        <asp:GridView ID="GridView1" runat="server" AllowPaging= "True"
        AutoGenerateColumns = "True" DataKeyNames="CustomerID" DataSourceID="LinqDataSource1" >
        </asp:GridView>

        <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="NorthwindDataContext"
        EntityTypeName= "" OrderBy="CompanyName" TableName="Customers" >
        </asp:LinqDataSource>

        <asp:DynamicDataManager ID="DynamicDataManager1" runat="server">
        <DataControls>
            <asp:DataControlReference ControlID="GridView1" />
        </DataControls>
        </asp:DynamicDataManager>
    </div>
    </form>
</body>


Imar September 14th, 2013 06:50 AM

Is this a web site project and not an web application project? If so, the dbml file must be in App_Code.

Cheers,

Imar


All times are GMT -4. The time now is 09:20 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.