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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:51:58+00:00 2026-05-26T17:51:58+00:00

first i want to let you know that i never used XML as datasource

  • 0

first i want to let you know that i never used XML as datasource before.

i have an XML file called “answers.xml” and i need to connect gridview, formview, etc…

<?xml version="1.0"?>
<Answers>  
<AnswerSet>
    <Answer questionId="MRN">4444</Answer> 
    <Answer questionId="FName">test</Answer> 
    <Answer questionId="LName">patient</Answer> 
    <Answer questionId="AddressPt">blah blah</Answer> 
    <Answer questionId="Governorate">xxxx</Answer> 
    <Answer questionId="InitialCSF">Negative</Answer> 
    <Answer questionId="Diagnosis"></Answer> 
    <Answer questionId="Description"> </Answer>   
</AnswerSet>   
<AnswerSet> 
    <Answer questionId="MRN">1</Answer> 
    <Answer questionId="FName">1</Answer> 
    <Answer questionId="LName">1</Answer> 
    <Answer questionId="AddressPt">1</Answer> 
    <Answer questionId="InitialCSF">Positive</Answer> 
    <Answer questionId="Diagnosis">dx</Answer> 
    <Answer questionId="Description"> </Answer>   
</AnswerSet>
</Answers>

I need a way to change the data (edit / delete) in the xml file using .NET

  • 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-05-26T17:51:59+00:00Added an answer on May 26, 2026 at 5:51 pm

    If you don’t want to use an XmlDataSource control, you could also use LINQ to XML to create a datasource object from the file:

    XDocument doc = XDocument.Load("somefile.xml");
    
    var results = from answer in doc.Descendants("Answer")
                  select new
                  {
                      Question = answer.Attribute("questionId").Value,
                      Answer = answer.Value
                  };
    
    GridView1.DataSource = results;
    GridView1.DataBind();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all, let me clarify that I know you cannot have actual abstract
Let's imagine I want to make a templated function that returns the first element
I have a problem but first i want to know if im working on
I have an appender that I only want the first X characters (for this
Let me state first: I know that any user that wants to run a
First, let me admit that what I know about HTTPS is pretty rudimentary. I
I want to let the User Know that the App is loading Data, so
Let's say, that I have the following source output: <p>This is first paragraph</p> <p>This
First let me tell you what I want to achieve. I want a layout
First I want to describe my situation briefly. I have two classes, one MainClass

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.