Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Xml validation in c#

Xml validation in c#

Scheduled Pinned Locked Moved C#
xmlhelpcsharpdatabase
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kunthavai
    wrote on last edited by
    #1

    Hi, I am trying to validate a xml document against xsd in c#. I used the code

    XmlReaderSettings settings = new XmlReaderSettings();
    settings.ValidationType = ValidationType.Schema;

    And i get the following error. TesterSchemaValidator.settings' is a 'field' but is used like a 'type' Please help me, why i am getting this error.

    E 1 Reply Last reply
    0
    • K kunthavai

      Hi, I am trying to validate a xml document against xsd in c#. I used the code

      XmlReaderSettings settings = new XmlReaderSettings();
      settings.ValidationType = ValidationType.Schema;

      And i get the following error. TesterSchemaValidator.settings' is a 'field' but is used like a 'type' Please help me, why i am getting this error.

      E Offline
      E Offline
      Eslam Afifi
      wrote on last edited by
      #2

      You're setting the ValidationType in the class level (outside a method).

      Eslam Afifi

      K 1 Reply Last reply
      0
      • E Eslam Afifi

        You're setting the ValidationType in the class level (outside a method).

        Eslam Afifi

        K Offline
        K Offline
        kunthavai
        wrote on last edited by
        #3

        Thank you so much :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups