abburi chowdary

abburi chowdary

  • 1.8k
  • 60
  • 5.7k

C#, values in xml to combobox

Apr 23 2018 4:03 AM
hi
 
i have written below code for getting records in combobox from xml but i am unabale to display records.
 
please suggest me
  1. void MainFormLoad(object sender, EventArgs e)  
  2. {  
  3. string myXmlfile=@"C:\Users\anusha\Documents\SharpDevelop Projects\hospitals.xml";  
  4. DataSet ds= new DataSet();  
  5. System.IO.FileStream fsReadXml= new System.IO.FileStream  
  6. (myXmlfile,System.IO.FileMode.Open);  
  7. ds.ReadXml(fsReadXml);  
  8. cmbHospitals.DataSource=ds;  
  9. cmbHospitals.DisplayMember="name";  
  10.   
  11. }  

Answers (5)