I have a xml file in my project. I am reading the file through the below code in to combobox cbProduct
. The problem is that the cbProduct
is displaying duplicate text values. How to make them distinct?
I have gone through some links but there way of approach is not related to dataset.
I implemented the below code:
DataSet ds = new DataSet();
ds.ReadXml(@"..\..\stock.xml");
cbProduct.DataSource = ds.Tables[0];
cbProduct.DisplayMember = "productname";
optional: If you have time it will be appreciable if you explain the process because I am new to .net or provide a link atleast to refer (not msdn).
Please Help.
Thanks in advance.