0
SharepointでSilverlightアプリケーションを使用してWCFサービスを使用しようとしています。SilverlightアプリケーションでLINQクエリを使用しているエラー
リストからすべてのデータをグリッドに表示します。何とかそれはエラーを投げている。
ラムダ式をデリゲート型ではないため 'system.Delegate'と入力できません。ジェネリック型「system.collections.generic.ienumerable」を使用して
は
SLprojectsCRUD2010WCF.sharepointservice.list1itemが」タイプであるが、変数のように使用されている1型の引数が必要です。
どのように解決できますか?あなたのソースコードが適切にフォーマットされるまで
private SharePointService.SkinnyBlondeDataContext _context;
public MainPage()
{
InitializeComponent();
this.Loaded += new RoutedEventHandler(LayoutRoot_Loaded);
}
private void ShowProjects()
{
// Declare the LINQ query
var projectsQuery = (from p in _context.Tasks
select p) as DataServiceQuery<SharePointService.TasksItem>;
// Execute the LINQ query
projectsQuery.BeginExecute((IAsyncResult asyncResult) => Dispatcher.BeginInvoke(() =>
{ // Runs in the UI thread
// EndExecute returns
IEnumerable <TasksItem> this.dataGridProjects.ItemsSource = projectsQuery.EndExecute(asyncResult).ToList();
}), projectsQuery);
}
private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
{
// Get the context
_context = new SharePointService.SkinnyBlondeDataContext(
new Uri("http://vanir0269/_vti_bin/listdata.svc", UriKind.Absolute));
ShowProjects();
}
あなたの投稿をフォーマットしてください。私は普通あなたのためにやっていますが、それは恐ろしい*状態にあり、おそらくソースコードからより簡単に行うことができます。 –