更新时间:2022-06-19 03:04:45
我认为为此目的使用键入的DataSet
会很容易.
您可以看一下这篇文章
用于从DataBase和使用反射将DataTable保存到数据库中 [ http://msdn.microsoft.com/en-us/library/system. windows.forms.datagridviewcomboboxcolumn.aspx [ ^ ]
I think it will be easy to use typedDataSet
s for this purpose.
You can take a look at this article
General purpose class to fill DataTable(s) from DataBase and to save DataTable(s) to DataBase using reflection[^]
for easily filling theDataTable
s from database and savingDataTable
s to database.
Then to bind theDataGridViewComboboxColumn
set theDataSource
property to yourDataTable
andValueMember
,DisplayMember
properties to field required in the table.
An example is given here
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcomboboxcolumn.aspx[^]