T
Tammy Nejadian
Hi,
I am using visual studio C# window and I have an xml file which I need to
read that file using Object Oriented program. What codes I should use in my
class to load and read that xml file. Thanks
My xml file call carsXml.xml and it includes below information:
<?xml version="1.0" encoding="utf-8" ?>
<carlot>
<car>
<Make>OldsMobile</Make>
<Model>Cutlas</Model>
<Milage>5000</Milage>
</car>
<car>
<Make>Chevelate</Make>
<Model>Camro</Model>
<Milage>6000</Milage>
</car>
</carlot>
My Class calls carClass however it is not completed. I dont know how to lead
that xml file here to read it. The codes I have are:
class carClass
{
//Field
private string _model;
private string _make;
private int _milage;
//properties
public string Model
{
get { return _model; }
set { _model = value; }
}
public string Make
{
get { return _make; }
set {_make = value; }
}
public int Milage
{
get { return _milage; }
set { _milage = value;}
}
}
I am using visual studio C# window and I have an xml file which I need to
read that file using Object Oriented program. What codes I should use in my
class to load and read that xml file. Thanks
My xml file call carsXml.xml and it includes below information:
<?xml version="1.0" encoding="utf-8" ?>
<carlot>
<car>
<Make>OldsMobile</Make>
<Model>Cutlas</Model>
<Milage>5000</Milage>
</car>
<car>
<Make>Chevelate</Make>
<Model>Camro</Model>
<Milage>6000</Milage>
</car>
</carlot>
My Class calls carClass however it is not completed. I dont know how to lead
that xml file here to read it. The codes I have are:
class carClass
{
//Field
private string _model;
private string _make;
private int _milage;
//properties
public string Model
{
get { return _model; }
set { _model = value; }
}
public string Make
{
get { return _make; }
set {_make = value; }
}
public int Milage
{
get { return _milage; }
set { _milage = value;}
}
}