标签:c# listbox ado .net entities framework
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WpfApplication68
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
BooksEntities booksEntities = new BooksEntities();
var test = from r in booksEntities.Books
select r;
foreach(var item in test)
{
listBox.Items.Add(item.Title);
}
}
}
}
【C#】使用ADO .Net Entities Framework 与WPF ListBox控件绑定
标签:c# listbox ado .net entities framework
原文地址:http://acadia627.blog.51cto.com/3992605/1735634