tags:

views:

34

answers:

1

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

A: 

Your XML probably doesn't match the expected format for loading as a dataset. Please provide the XML for further help.

Teun D
i try to debug but have data in datatable but its error when adding to combobox ?
monkey_boys