0
我試圖使用DataTable
LINQ
我用的nTier我的解決方案,但是,當我嘗試使用LINQ
在DataTable
它給了我一個錯誤:對不起,我的英語如何在DataTable中使用LINQ?
Error 1 Cannot convert lambda expression to type 'string' because it is not a delegate type c:\users\ba-ojt\documents\visual studio 2010\Projects\GoActiveDirectory\PresentationTier\Default.aspx.cs 21 25 PresentationTier
我怎樣才能修復這個 以及它如何成爲一個lambda表達式?
mycode的:
protected void Page_Load(object sender, EventArgs e)
{
DataServiceReference.Service1Client newService = new DataServiceReference.Service1Client();
DataTable dt = newService.GetAccounts();
var query = from data in dt
select data;//Error Here
Repeater1.DataSource = query;
Repeater1.DataBind();
}
MyReference:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.Entity;