abburi chowdary

abburi chowdary

  • NA
  • 60
  • 14.9k

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)