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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:15:27+00:00 2026-05-23T02:15:27+00:00

Been dabbling with a bit of ASP.NET. I current have the following error: Failed

  • 0

Been dabbling with a bit of ASP.NET. I current have the following error:
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints

It breaks on the following line:
DataTable propertyTable = pta.searchByType(sType);

Code:

String sType = Request.QueryString["type"];
DataSetTableAdapters.propertiesTableAdapter pta = new DataSetTableAdapters.propertiesTableAdapter();
DataTable propertyTable = pta.searchByType(sType);
if (propertyTable.Rows.Count > 0)
{
    lblStatus.Text = "Your Results";
    gvProperty.DataSource = propertyTable;
    gvProperty.DataBind();
}

The query that pta.searchByType(sType); is calling is:

SELECT     property_id, name, description, price, image, town
FROM         properties
WHERE     (date_approved IS NOT NULL) AND (property_type = @property_type)

The primary key for the properties table is property_id, the table has one FK that links to a users table but that’s it.

Any help pointing me in the right direction is great. If you need any more details just drop them in the comments below.

Thanks 🙂

  • 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-23T02:15:28+00:00Added an answer on May 23, 2026 at 2:15 am

    Are you selecting ALL the columns?

    See:
    http://forums.asp.net/t/1400495.aspx/1

    You can always cheat and set enable constraints to false on the table adapter, too.

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

Sidebar

Related Questions

I have been dabbling a little with clisp. It is a little perplexing that
I have been dabbling in programming/scripting languages since I was a kid. I started
I'm into my first 3 months of web development and I have been dabbling
Been a while since I've dealt with ASP.NET and this is the first time
I have been a dabbling into delphi off and on for years and I
Been having lot's of trouble with this one. Let's say I had the following
I have been dabbling in game development as a hobby for a while now,
I have been dabbling in WCF RIA with Silverlight for the past few weeks
I am not a Cocoa developer, but I have been dabbling in it to
I have been dabbling around this morning trying to modify the jQuery cycle script

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.