Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9184977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:11:02+00:00 2026-06-17T19:11:02+00:00

My XML Example: <Table diffgr:id=Table17 msdata:rowOrder=16> <IdRec>17</IdRec> <FieldId>1213</FieldId> <FieldDesc>Equipment</FieldDesc> <FieldType>OptionBOX</FieldType> <isReadOnly>false</isReadOnly> <FieldValue>388</FieldValue> <FieldTextValue>B –

  • 0

My XML Example:

<Table diffgr:id="Table17" msdata:rowOrder="16">
    <IdRec>17</IdRec>
    <FieldId>1213</FieldId>
    <FieldDesc>Equipment</FieldDesc>
    <FieldType>OptionBOX</FieldType>
    <isReadOnly>false</isReadOnly>
    <FieldValue>388</FieldValue>
    <FieldTextValue>B - satisfactory</FieldTextValue>
    <OptBox_Options>
        <Options>
            <myOPT FieldValue="387" FieldTextValue="A - good"/>
            <myOPT FieldValue="388" FieldTextValue="B - satisfactory"/>
            <myOPT FieldValue="389" FieldTextValue="C - needs change"/>        
            <myOPT FieldValue="390" FieldTextValue="D - deal"/>
        </Options>
    </OptBox_Options>
</Table>

My problem
The above xml data comes from a webservice. I have no problem with any field other than OptBox_Options which is a field I need to use to populate my spinner. Ergo I need to get the string from OptBox_Options->Options->myOpt(FieldTextValue) (for example: ).

How to access this data? What would be the best approach. If you can’t give me a direct solution I would be satisfied with a link to noob friendly C# tutorial on the subject.

Isssue Resolved

I transformed my string to XML, then converted it to a dataset and just cycled through it… Code below 🙂

List<string> entries = new List<string>();

String rawXML = item.OptBox_Options;

StringReader stream = null;
XmlTextReader reader = null;

DataSet xmlDS = new DataSet();
stream = new StringReader(rawXML);
// Load the XmlTextReader from the stream
reader = new XmlTextReader(stream);
xmlDS.ReadXml(reader);

DataSet myOPTvalues = new DataSet();
myOPTvalues = xmlDS;

foreach (DataRow row in myOPTvalues.Tables[0].Rows)
{
var optItem = new PrevzemSpin();
optItem.FieldValue = row["FieldValue"].ToString();
if (optItem.FieldValue.Equals("")) optItem.FieldValue = null;

optItem.FieldTextValue = row["FieldTextValue"].ToString();
if (optItem.FieldTextValue.Equals("")) optItem.FieldTextValue = null;

entries.Add(optItem.FieldTextValue);
SpinnerValue.Tag = optItem.FieldValue;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:11:03+00:00Added an answer on June 17, 2026 at 7:11 pm

    I transformed my string to XML, then converted it to a dataset and just cycled through it… Code below 🙂

    List<string> entries = new List<string>();
    
    String rawXML = item.OptBox_Options;
    
    StringReader stream = null;
    XmlTextReader reader = null;
    
    DataSet xmlDS = new DataSet();
    stream = new StringReader(rawXML);
    // Load the XmlTextReader from the stream
    reader = new XmlTextReader(stream);
    xmlDS.ReadXml(reader);
    
    DataSet myOPTvalues = new DataSet();
    myOPTvalues = xmlDS;
    
    foreach (DataRow row in myOPTvalues.Tables[0].Rows)
    {
        var optItem = new PrevzemSpin();
        optItem.FieldValue = row["FieldValue"].ToString();
        if (optItem.FieldValue.Equals("")) optItem.FieldValue = null;
    
        optItem.FieldTextValue = row["FieldTextValue"].ToString();
        if (optItem.FieldTextValue.Equals("")) optItem.FieldTextValue = null;
    
        entries.Add(optItem.FieldTextValue);
        SpinnerValue.Tag = optItem.FieldValue;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I store some xml data in a table. Example: INSERT INTO table (id, value)
I have example XML in one of the table column: <Root> <A> <C>c</C> <D>d</D>
I have the following example XML: <Table> <Row Position=0 Name=FName /> <Row Position=1 Name=LName
Does anyone have an example of a pivot using a table with an XML
How to access the comments inside the XML document using XPath? For example: <table>
I have the following XML example <?xml version=1.0?> <test> <items> <item>item 1</item> <item>item 2</item>
So I have the following XML chain: $xml->assessment->outcomes_processing->outcomes->decvar->attributes()->cutvalue XML example In Some XML-files $xml->assessment->outcomes_processing->outcomes->...
Example XML using element nodes: <?xml version=1.0 encoding=utf-8?> <users> <user> <name>David Smith</name> <phone>0441 234443</phone>
Given this example XML file: <doc> <tag> Hello ! </tag> <tag> My name is
This is an example XML file that would come from the Android Client. <test>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.