当前位置:Gxlcms > 数据库问题 > Linq to SQL 绑定 ComboBox

Linq to SQL 绑定 ComboBox

时间:2021-07-01 10:21:17 帮助过:24人阅读

void SearchBtn_Click(object sender, EventArgs e) { //读取表数据并绑定Combox空间 using (OrderDBContainer db = new OrderDBContainer()) { CBox_User.DisplayMember = "Name"; CBox_User.ValueMember = "Id"; CBox_User.DataSource = from u in db.UserAccoutSet orderby u.LastName select new { Name = u.LastName + ", " + u.FirstName, Id = u.Id }; } }

打赏支付宝:

技术分享

Linq to SQL 绑定 ComboBox

标签:java   uri   model b   new   dig   www   obj   ros   表数   

人气教程排行