【C#】使用ADO .Net Entities Framework 与WPF ListBox控件绑定

发布时间:2020-06-16 12:14:03 作者:daniel8294
来源:网络 阅读:483

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);

            }

            

        }

    }

}


推荐阅读:
  1. 【C#】ADO .Net Entities Framework在WPF TreeView中的应用
  2. 【C#】ADO .Net Entities Framework使用查询语句时遇到的错误

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

net ado listbox

上一篇:redis集群的原理以及搭建配置

下一篇:js正则表达式控制文本框输入浮点数

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》