IIS7 webserver linq to sql error

I configured a simple ASP.NET website on Windows Server 2008 R2 in IIS7 and it worked well, but now when I want it to use database for showing information, I get this error in Internet Explorer:

Compilation Error 
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: CS0246: The type or namespace name 'DataClassesDataContext' could not be found (are you missing a using directive or an assembly reference?)

Source Error:



`Line 10:    protected void Page_Load(object sender, EventArgs e)`
`Line 11:    {`
`Line 12:    DataClassesDataContext db = new DataClassesDataContext();`
`Line 13:    var q = from i in db.Table1s`
`Line 14:            select i;`

Source File: c:inetpuborangessubDefault.aspx.cs    Line: 12 

Then I tried that on windows 7 in IIS7 and it works well!

I used LINQ-To-SQL in Visual Studio 2010, and here is my code:

DataClassesDataContext db = new DataClassesDataContext();
var q = from i in db.Table1s
        select i;

foreach (var i in q)
    ListBox1.Items.Add(i.data);

What's the problem?

How can I fix that??

链接地址: http://www.djcxy.com/p/35910.html

上一篇: Paypal Express购物车结账前的价格

下一篇: IIS7网络服务器LINQ到SQL错误