Helllo,我收到此错误:
CS0246: The type or namespace name ‘DataClasses1DataContext’ could not be found (are you missing a using directive or an assembly reference?)
对于此.aspx文件:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class WebApplication1_admin_Places : System.Web.UI.Page { protected void Page_Load(object sender,EventArgs e) { DataClasses1DataContext db = new DataClasses1DataContext(); var query = (from m in db.Places orderby m.Name select m); PlacesList.DataSource = query; PlacesList.DataBind(); } }
事情是,在/文件夹我可以访问数据库,但在/ admin文件夹我得到这个错误.
我究竟做错了什么?
编辑
CS0012:类型’System.Data.Linq.DataContext’在未引用的程序集中定义.您必须添加对程序集’System.Data.Linq,Version = 3.5.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089’的引用.
那是什么意思?