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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:09:47+00:00 2026-06-03T13:09:47+00:00

Very new to .Net. Everything was working fine until I added <Tracking> to my

  • 0

Very new to .Net. Everything was working fine until I added <Tracking> to my XML file:

<Product>
    <id>product1</id>
    <Name>Product 1</Name>
    <Packart>detailimg</Packart>
    <TitleFile>detailtitleoriginal</TitleFile>
    <Description>Description</Description>
    <Ingredients>Ingredients</Ingredients>
    <FeedingInstructions>Instructions</FeedingInstructions>
    <Analysis>Analysis</Analysis>
    <Footer>Footer</Footer>
    **<Tracking>Test</Tracking>**
</Product>

My XSD file is such:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="Products">
        <xs:complexType>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" name="Product">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="id" type="xs:string" />
                            <xs:element name="Name" type="xs:string" />
                            <xs:element name="Packart" type="xs:string" />
                            <xs:element name="TitleFile" type="xs:string" />
                            <xs:element name="Description" type="xs:string" />
                            <xs:element name="Ingredients" type="xs:string" />
                            <xs:element name="FeedingInstructions" type="xs:string" />
                            <xs:element name="Analysis" type="xs:string" />
                            <xs:element name="Footer" type="xs:string" />
                            <xs:element name="Tracking" type="xs:string" /></xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Then in my aspx page I added:

<%=row[ "Tracking"]%>

When I view the page in a browser I get the error:

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Source Error: 


Line 19:             ds = new System.Data.DataSet();
Line 20:             ds.ReadXmlSchema(MapPath("Content/xml/Products.xsd"));
Line 21:             ds.ReadXml(MapPath("Content/xml/Products.xml"));
Line 22:             Cache.Insert("Products", ds, new System.Web.Caching.CacheDependency(MapPath("Content/xml/Products.xml")),
Line 23:                          DateTime.Now.AddHours(12), System.Web.Caching.Cache.NoSlidingExpiration);

Source File: d:\ProductDetails.aspx.cs    Line: 21 
  • 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-03T13:09:48+00:00Added an answer on June 3, 2026 at 1:09 pm

    One way to overcome this issue quickly is to disable EnforceConstraints on the dataset:

    ds.EnforceConstraints = false;
    //now you can load the data 
    

    UPDATE: This may have unwanted repercussions, obviously. You should decide whether this is the case or not in your scenario.

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

Sidebar

Related Questions

I am relatively new to ASP.NET MVC, and am very impressed with the clarity
Very new to XSL (and XML for that matter), but I need to step
I'm following Pro ASP.Net MVC2 book and literally 90% of everything is new to
I'm fairly new to asp.net/c# and very new to jQuery so please forgive me
I'm new to ASP.NET MVC and I'm trying to create a very simple blog
I used to have a WORKING database for my ASP.NET site, up until the
Very new to FluentNHibernate, but I'm also excited about the area. I've recently started
Very new to JQuery and MVC and webdevelopment over all. I'm now trying to
Very new to using Raphael.js I'm looking at the tutorials and I am able
Very new mobile developer here... I am trying to retrieve a list of tweets

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.