const columnName = "你的列名";
DataSet ds; //你的ds
DataTable dt = ds.Tables[0];
String[] resultArray = new String[dt.Rows.Count];
int i = 0;
foreach(DataRow r in dt.Rows)
{
resultArray[i] = Convert.ToString(r[columnName]);
i++;
}
//resultArray里便是你要的结果,这里仅以字符串数组作为示例
//输出到一维数组
private string[] FunctionToArray(DataSet ds)
{
string[] strArr = new string[ds.Tables[0].Rows.Count];
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
strArr[i] = ds.Tables[0].Rows[i][0].ToString();
}
return strArr;
}
//输出到ComboBox中
private void FunctionToComboBox(DataSet ds, ComboBox comboBox1)
{
comboBox1.Items.Clear();
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
comboBox1.Items.Add(ds.Tables[0].Rows[i][0]);
}
}