IIS7网络服务器LINQ到SQL错误

我在IIS7中的Windows Server 2008 R2上配置了一个简单的ASP.NET网站,它运行良好,但现在当我希望它使用数据库显示信息时,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 

然后,我在IIS7的Windows 7上试了一下,效果很好!

我在Visual Studio 2010中使用了LINQ-to-SQL,这里是我的代码:

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

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

有什么问题?

我该如何解决这个问题?

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

上一篇: IIS7 webserver linq to sql error

下一篇: How to integrate Paypal payment Gateway in asp.net website