我在c#中有以下代码。LINQ to SQL System.Data.Linq.DataContext未引用
using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using V2.PaidTimeOffDAL;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnView_Click(object sender, EventArgs e)
{
HRPaidTimeOffDataContext db = new HRPaidTimeOffDataContext();
var userAccounts =
from u in db.BMS_Users
select u;
GridView1.DataSource = userAccounts;
GridView1.DataBind();
}
}
每当我考试,我得到以下错误“System.Data.Linq.DataContent在未引用的程序集定义。您必须添加到assemply“将System.Data.Linq版本的引用= 3.5.0.0'文化=中立PublicKeyToken = ############“。
每当我尝试使用将System.Data.Linq我获得以下错误添加指令“的类型或命名空间名称‘灵’不存在命名空间存在‘System.Data’”
我是新来的LINQ to SQL。请协助
您的项目的目标平台是什么?检查属性,你可能会低于3.5? – Derek 2012-07-11 07:46:21
错误是否真的读了“Ling”,用G?它应该是Linq,其中Q. – 2012-07-11 07:49:23
@ J.P.tenBerge它的Q – Tamseyc 2012-07-11 08:20:19