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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:12:06+00:00 2026-05-11T17:12:06+00:00

I’m currently working on a small web application using Visual Studio 2008 Express. I’m

  • 0

I’m currently working on a small web application using Visual Studio 2008 Express. I’m attempting to retrieve an XML document from a server using a client library and then save the document into a database column (using Linq). The database column has the data type specified as xml. Unfortunately, I’ve been unsuccessful during my first few attempts.

Assuming that I’ve already got a reference to the data context object, here is the basics of what it is that I’m attempting to do:

// using a client library, requestthe XML document from the server
XmlDocument oXmlDoc = oClient.GetDataAsXML();

InformationLog oLog = new InformationLog();
oLog.InfoXML = oXmlDoc.InnerXml; // this is where the problem occurs

dbContext.InformationLogs.InsertOnSubmit(oLog);
dbContext.SubmitChanges();

Specifically, the error I get is:

Cannot implicitly convert type 'System.Xml.XmlNode' to 'System.Xml.Linq.XElement'

I’m new to ASP.NET MVC and Linq, so I know that I’m missing something. In addition to the answer, I’m also curious as to why it’s impossible to simply save the XML as-is without any additional processing.

  • 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-11T17:12:06+00:00Added an answer on May 11, 2026 at 5:12 pm

    You should look to use XDocument rather than XmlDocument, and then try assigning the XDocument directly to your oLog.InfoXML property.

    Without knowing how oClient.GetDataAsXML() works it’s not clear whether you can easily create an XDocument from that call, but your life will be easier if you work in terms of XDocument instead of XmlDocument.

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

Sidebar

Ask A Question

Stats

  • Questions 109k
  • Answers 109k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I hadn't listed the actual cause of the issue while… May 11, 2026 at 9:23 pm
  • Editorial Team
    Editorial Team added an answer Does #mainadslot have more than one Element that can be… May 11, 2026 at 9:23 pm
  • Editorial Team
    Editorial Team added an answer You do the following: c2.start(); // Start a thread in… May 11, 2026 at 9:23 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.