如何在.net c#desktop应用程序中将下拉列表与数据库绑定 [英] how to bind drop down with database in .net c# desktop application
本文介绍了如何在.net c#desktop应用程序中将下拉列表与数据库绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在.net c#desktop application中绑定下拉数据库
how to bind drop down with database in .net c# desktop application
推荐答案
嗨..
请看这个链接。 />
http://www.aspdotnet-suresh。 com / 2012/10 / showbind-data-to-aspnet-dropdownlist.html [ ^ ]
谢谢你。
Hi..
See this link.
http://www.aspdotnet-suresh.com/2012/10/showbind-data-to-aspnet-dropdownlist.html[^]
Thank u.
binding-data-to-combobox-in-c-windows.html [ ^ ]
binding-combobox-in-windows.html [ ^ ]
databinding-in-combobox-using-c-sharp.aspx [ ^ ]
希望它会有所帮助..
binding-data-to-combobox-in-c-windows.html[^]
binding-combobox-in-windows.html[^]
databinding-in-combobox-using-c-sharp.aspx[^]
Hope it will help..
DataTable dataTable = GetDataTable(Select * from Student); //你必须实现从数据库中检索数据的方法。
comboBox1.Datasource = dataTable;
comboBox1.DisplayMember = StudentName; //列名
comboBox1.ValueMember = StuentId; //列名
DataTable dataTable = GetDataTable("Select * from Student"); // You have to implement the ways to retrieve data from the database.
comboBox1.Datasource = dataTable;
comboBox1.DisplayMember = StudentName; // Column Name
comboBox1.ValueMember = StuentId; // Column Name
这篇关于如何在.net c#desktop应用程序中将下拉列表与数据库绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文