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 8176719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:18:23+00:00 2026-06-06T23:18:23+00:00

I am parsing a XML file and I want to insert the parsed values

  • 0

I am parsing a XML file and I want to insert the parsed values into the database,I parsed a set of values and placed in a variable “data”. Now I want to pick each values from the variable.Can any one help me,I am a newbie?

The code

  XDocument xdoc = XDocument.Parse(e.Result);
  var data = from query in xdoc.Descendants("returnData")
                   select new fieldvalue
                   {
                       Authenticated = (String)query.Element("authenticated"),
                       Repphoto = (String)query.Element("rep_photo"),
                       Repuname = (String)query.Element("rep_uname"),
                       Repemail = (String)query.Element("rep_email"),
                       Repphone = (String)query.Element("rep_phone"),
                       Repwebsite = (String)query.Element("rep_website"),
                       Userimgsize = (String)query.Element("user_img_size"),
                       Usersigsize = (String)query.Element("user_sig_size")
                     };

The class file

public class fieldvalue
{
    String authenticated, rep_photo, rep_uname, rep_email, rep_phone, rep_website, user_img_size, user_sig_size;
  public String Authenticated
    {
        get { return authenticated; }
        set { authenticated = value; }
    }
    public String Repphoto
    {
        get { return rep_photo; }
        set { rep_photo = value; }
    }
    public String Repuname
    {
        get { return rep_uname; }
        set { rep_uname = value; }
    }
    public String Repemail
    {
        get { return rep_email; }
        set { rep_email = value; }
    }
    public String Repphone
    {
        get { return rep_phone; }
        set { rep_phone = value; }
    }
    public String Repwebsite
    {
        get { return rep_website; }
        set { rep_website = value; }
    }
    public String Userimgsize
    {
        get { return user_img_size; }
        set { user_img_size = value; }
    }
    public String Usersigsize
    {
        get { return user_sig_size; }
        set { user_sig_size = value; }
    }
}
}
  • 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-06T23:18:25+00:00Added an answer on June 6, 2026 at 11:18 pm

    Now I want to pick each values from the variable.

    Cast IEnumerable<fieldvalue> result to ToList<> and use index to access each element.

    var data = (from query in xdoc.Descendants("returnData")
                       select new fieldvalue
                       {
                           Authenticated = (String)query.Element("authenticated"),
                           Repphoto = (String)query.Element("rep_photo"),
                           Repuname = (String)query.Element("rep_uname"),
                           Repemail = (String)query.Element("rep_email"),
                           Repphone = (String)query.Element("rep_phone"),
                           Repwebsite = (String)query.Element("rep_website"),
                           Userimgsize = (String)query.Element("user_img_size"),
                           Usersigsize = (String)query.Element("user_sig_size")
                         }).ToList();
    

    Something like:

    var name=data[0].Repuname;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am parsing an XML file into a table and want to use the
I am parsing an XML file into a table and want to use the
I have an XML file that I want to parse into a database in
I've used following code for parsing XML file in c++. http://www.codeproject.com/Articles/176236/Parsing-an-XML-file-in-a-C-C-program . Now I
I want to use DOM4j for parsing xml file in Java. I have this
I am parsing an XML file where one of the fields I want to
I'm parsing an XML file an get a string as NSMutableString . Now I
I am doing parsing on xml file and fetched data from xml file and
I'm new to XML parsing and want to convert XML file resulting from a
I am parsing an XML file, and after extracting some information, I want to

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.