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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:56:36+00:00 2026-06-13T19:56:36+00:00

I have some stored proc.s that get data from DB. I made some data

  • 0

I have some stored proc.s that get data from DB.
I made some data access layers classes to get the data from the sql db
I have some Xml files that should be filled with this data.
I’m supposed to link between them using aspx pages.
Now, I want to know how can I read data at the aspx page from the xml file to send it to the server, and how can I write data from the db to the xml files.

I used to use json, but is there a method in which I can send and receive data without using json & just using XML ?

This is my XML File:

<allNews>
<news>
    <gNews>
        <flag>List of categories IDs this article linked to</flag>
        <title>news title goes here</title>
        <description>news description goes here</description>
        <date>news date goes here</date>
    </gNews>
</news> 

This is the function that retrieves a list from the database:

XDataContext XDB = new XDataContext();

    public getCategoryContentListResult GetCategoryContentList(int contentID)
    {
        return XDB.getCategoryContentList(contentID).SingleOrDefault<getCategoryContentListResult>();
    }

I want to know how can I connect these two files using aspx.

When I used Json I used to do this: [I read data from an ajax call at the javascript file)

        private getCategoryContentListResult GetCategoryList()
        {     
              int ContentID = int.parse(Request.QueryString["country"]);     
              int res = getCategoryContentListResult(ContentID);
              JsonResponse = JsonConvert.SerializeObject(res);
        }
        Response.Clear();
        Response.ContentType = "application/json";
        Response.ContentEncoding = System.Text.Encoding.UTF8;
        Response.Write(Request.QueryString["jsoncallback"] + "(" + JsonResponse + ");");
        Response.End(); 

Now I can’t use Json, I just have to use XML. SO is there some method to do it ?

  • 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-13T19:56:38+00:00Added an answer on June 13, 2026 at 7:56 pm

    Try modifying the below code accordingly

    protected void Page_Load(object sender, EventArgs e)
        {
            XmlTextWriter writer = new XmlTextWriter("your.xml", System.Text.Encoding.UTF8);
            writer.WriteStartDocument(true);
            writer.Formatting = Formatting.Indented;
            writer.Indentation = 2;
            writer.WriteStartElement("AllNews");
            writer.WriteStartElement("News");
            //Loopthrough your dataset/datatable/Or datareader here
            //Call the CreateNode Method from here 
            //End of loop
            writer.WriteEndElement();
            writer.WriteEndElement();
            writer.WriteEndDocument();
            writer.Close();
    
    
    
        }
    
        private void createNode(string flag, string title, string desc, string date, XmlTextWriter writer)
        {
            writer.WriteStartElement("GNEWS");
            writer.WriteStartElement("flag");
            writer.WriteString(flag);
            writer.WriteEndElement();
            writer.WriteStartElement("title");
            writer.WriteString(title);
            writer.WriteEndElement();
            writer.WriteStartElement("description");
            writer.WriteString(desc);
            writer.WriteStartElement("date");
            writer.WriteString(date);
            writer.WriteEndElement();
            writer.WriteEndElement();
        }
    

    Hope this will help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a stored proc which unions some data and returns back. At max
I have a data-source connected to a stored proc that will return the one
I have a series of stored procedures that select data from a db. I
I have a stored proc that takes an input of xml value like this:
I have a stored proc that processes a large amount of data (about 5m
I have a oracle stored proc that needs to be called from my Java
I have some html stored in database . I dont know that html stored
I have some files stored at amazon. all in private mode, and since I
I have some files stored in a database blob column in Oracle 9. I
This is just for debugging purpose. We have an abused stored proc that takes

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.