1

I use a dataset for reading a XML

ds.ReadXML(steam);

My XML look like this :

<models.Client>
    <id>1</id>
    <libelle>test</libelle>
    <nbSite>0</nbSite>
    <cabinet>false</cabinet>
    <clinique>false</clinique>
    <irm>0</irm>
    <scanner>0</scanner>
    <adresse>
        <id>1</id>
        <ligne1>1, rue toto</ligne1>
        <ligne2 />
        <codePostal />
        <ville />
        <coordonnee>
            <id>1</id>
            <telephone />
        </coordonnee>
    </adresse>
</models.Client>

How I can get the "ligne1" value ? for "libelle", I get the value this way : ds.Tables[0].Rows[0]["libelle"].ToString(); and it's ok, but "ligne1" is a child of models.Client.

thanks

1 Answer 1

2

It will be the second (index = 1) datatable, so:

ds.Tables[1].Rows[0]["ligne1"].ToString();

which will print: 1, rue toto

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.