Xml help
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Xml;
namespace xmlBase
{
public class xmlBase
{
public string XmlFileName
{
set;
get;
}
public object[] Select(string column) {
object[] select = new object[10];
DataSet ds = new DataSet();
DataTable dt = new DataTable();
ds.ReadXml(XmlFileName);
dt = ds.Tables[0].Copy();
int i = 0;
foreach (DataRow dr in dt.Rows)
{
select[i] = dt.Rows[i][column];
i++;
}
return select;
}
}
}
comb
comboBox1.Items.AddRange(xb.Select("Name"));
Value cannot be null. Parameter name: item