Questions tagged [constraintexception]

19 questions
7
votes
1 answer

Handling XSD Dataset ConstraintExceptions

Does anyone have any tips for dealing with ConstraintExceptions thrown by XSD datasets? This is the exception with the cryptic message: System.Data.ConstraintException : Failed to enable constraints. One or more rows contain values violating…
Jonathan Webb
  • 1,573
  • 1
  • 17
  • 26
3
votes
2 answers

My SQL table is set to allow NULL for this column, but when I run it, it says it cannot be NULL. What/Why/How?

so I have quite the odd predicament here. My SQL table is set to allow nulls for my ZipCode column, like so: CREATE TABLE [dbo].[Companies] ( [CompanyId] BIGINT IDENTITY(1,1) NOT NULL PRIMARY KEY, [Name] NVARCHAR(100) NOT NULL, …
2
votes
1 answer

String CONSTRAINT_ERROR length check failed

I have an array that holds strings of a maximum of 20 characters: subtype c_string is string(1..20); type string_array is array (natural range 1..100) of c_string; When I try to assign a string to a position of string_array, I get the following…
user3146897
  • 541
  • 1
  • 5
  • 15
2
votes
3 answers

Query field values from SQL Server Compact

(playerListTableAdapter.GetHeight(sortedPlayers[counter]) "Sorted Players" is an array of decimals, which match primary keys. When I call the query GetHeight, I get the following error: "ConstraintException was unhandled: Failed to enable…
Dominique
  • 167
  • 10
2
votes
1 answer

JPA Using GenerationType.IDENTITY @onetomany Postgres Child (many) table insert fails: Not Null Constraint Error On Parent FK

Given a team has many players. Using JPA/Hibernate. Postgres 9.1. GenerationType.IDENTITY (Postgres uses sequences on int columns like Oracle). On a new insert when I em.persist() I get a not-null error on the child table (player table in my very,…
Bill Rosmus
  • 2,941
  • 7
  • 40
  • 61
1
vote
0 answers

Constraints exception handling on weblogic by java hipster

A project generated by Jhipster and deployed on weblogic server. Everythings works fine on weblogic server except constranits exceptions handling. On tomcat when happen constraints exception is returned status error code 409 correctly but on…
1
vote
1 answer

Kotlin + Spring Data Exception (Constraint violation)

I'm coding a quite simple REST API using Spring Boot/Spring Data with Kotlin. The basic idea is that a Person can have many books. So I want to make a CRUD operation where I want to create, consult, etc. I'm using the H2 database and I'm already…
1
vote
2 answers

Constraint Error running Heapify SiftDown

I am writing this code in Ada for a class where we have to teach ourselves the code. I understand heap sort, but the Ada syntax is really confusing me. I don't understand why I am getting a constraint error in this sort function. Essentially we have…
1
vote
1 answer

Android studio and Room - Foreign keys and constraint failed

I'm trying to make an app with Room database. I have one table Bird and one table Family. (One-to-many relationship). @Entity(tableName ="bird", foreignKeys = @ForeignKey(entity = Family.class, parentColumns = "id", …
1
vote
0 answers

Prevent duplicate when filling datatable

I am doing a barcode scan application, so every time user scan a barcode the application retrieve a row from database and fill to the DataTable. I set clearbeforefill=false because i want the user to see the result for every scan. I want to prevent…
Yung
  • 11
  • 1
1
vote
1 answer

datatable constraintsexception occurs when dt.load(reader)

I have a project with c# and mysql. For querying, i prepared stored procedures and used public Sorgulama sp_call(string sp_query, Dictionary parameters) { Sorgulama sorgulama = new Sorgulama(); sorgulama.hatasiz…
fuatkaraca
  • 47
  • 8
1
vote
0 answers

SQLLiteDatabase error while using DetectedActivities API from google maps

I get an error from sqllite that says something like this. Now I checked the logs, and it always seems to appear random. It's never after the same funcion or log line. This is the error: 12-10 16:12:19.397: E/SQLiteDatabase(6496): Error inserting…
rosu alin
  • 5,674
  • 11
  • 69
  • 150
0
votes
1 answer

DataGridView System.Data.ConstraintException on row enter

Just as a starting note: I'm going through an existing app which was passed down to us and trying to go through and fix the bugs. I've been having issues with one particular DataGridView erroring out; giving me a Unique Constraint Exception on the…
0
votes
2 answers

ConstraintException Not Being Caught

First time poster. I've enjoyed many years of help here. Thanks everyone. I have a situation that looks like it should not be able to happen. Using VB.NET in VS2017 Community, I am getting a System.Data.ConstraintException in a Try block where I…
KenH
  • 3
  • 3
0
votes
1 answer

ConstraintException when filling a DataGridView from a SQL Server view

I have a SQL Server view which does a simple join of two tables and returns some of the columns. Running this view in Management Studio does not cause any problems, the expected data (two rows) is returned. When I use this view as data source for my…
Gorgsenegger
  • 7,356
  • 4
  • 51
  • 89
1
2