4
Reply

How to bind a combobox with XML

Vasanth Jack

Vasanth Jack

Feb 24 2017 8:43 AM
234
I have an XML file in Win forms.I want to Bind a xml in ComboBox ..I tried some code.But itz not working
 
 
DataSet ds = new DataSet();
ds.ReadXml(System.IO.Path.GetFullPath("Employee.xml"));
cbemp.DisplayMember = "EmployeeName";
cbemp.ValueMember = "EmployeeID";
cbemp.DataSource = ds.Tables[0];
 

Answers (4)