如何将List放入comboBox AddRange?

时间:2012-04-06 00:15:50

标签: c# list combobox

我有这个清单:

public static List<int> getData(OdbcConnection conn)
{
    List<int> myData = new List<int>();
    string myQuery = "some Sql text";
    // ...............some other code
    return myData;
}

我需要使用AddRange将参数从List添加到comboBox:

this.comboBox1.Items.AddRange( new object[] { ??????????? });

我该怎么做?

1 个答案:

答案 0 :(得分:6)

this.comboBox1.Items.AddRange(的getData(康涅狄格州).ToArray());

相关问题