473,378 Members | 1,578 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Problem bei Select Abfrage


Hallo zusammen,

Immer wenn ich per Select Statement ( SELECT ObjectId FROM tblArtikel
WHERE ArtNr = paramArtNr ) (paramArtNr ist ein String Parameter) über
einen TableAdapter absetze bekomme ich folgende ConstraintException:
"Einschränkungen konnten nicht aktiviert werden. Mindestens eine Zeile
enthält Werte die die Einschränkungen non-null, unique or foreign-key
verletzen."

Wahrscheinlich liegt das Problem bei der Column Object Id darum poste
ich hier mal die Einstellungen dieser Column:

AllowDbNull = true
AutoIncrement = true
AutoIncrementSeed = 2000
AutoIncrementStep = 1
Caption = ObjectId
DataTyp = System.Int32
DateTimeMode = UnspecifiedLocal
DefaultValue = <DBNull>
Expression = ""
MaxLength = -1
Name = ObjectId
NullValue = Throw Exception
ReadOnly = false
Source = ObjectID
Unique = False

Komisch finde ich, dass wenn ich die Abfrage mit der Visual Studio
Datenabfrage mache, kommen die Werte wunderbar.

Vielen Dank für eure Hilfe schon im Voraus.

Patrick


Dec 8 '06 #1
1 3990
Hello Patrick,

Ich glaube, in dieser Gruppe wird allgemein Englisch als Sprache bevorzugt
- nur als Tip, wenn die Antworten nicht so kommen :-)
>Immer wenn ich per Select Statement ( SELECT ObjectId FROM tblArtikel
WHERE ArtNr = paramArtNr ) (paramArtNr ist ein String Parameter) über
einen TableAdapter absetze bekomme ich folgende ConstraintException:

"Einschränkungen konnten nicht aktiviert werden. Mindestens eine Zeile
enthält Werte die die Einschränkungen non-null, unique or foreign-key
verletzen."
Ich bin nicht voellig sicher, aber ich glaube, dass ich solch eine Meldung
schon einmal gesehen habe, als die Daten in einer Tabelle nicht den in der
Datenbank eingerichteten Constraints genuegten. Da liest ADO.NET dann die
Konfiguration der Constraints aus der Datenbank und erwartet, dass diese
auch in den Daten entsprechend eingehalten sind - irgendwie hat man's aber
hinbekommen, dass das fuer irgendeinen Datensatz nicht gilt, und dann
kommt dieser Fehler raus. Am besten mal nachsehen, was fuer Constraints
fuer die Tabelle eingerichtet sind, und die Daten entsprechend pruefen.
>Wahrscheinlich liegt das Problem bei der Column Object Id darum poste ich
hier mal die Einstellungen dieser Column:
<snip>

Tja - ein guter Kandidat, aber da scheints ja keinerlei Constraints zu
geben. Das ist natuerlich in sich interessant, denn wenn das der
Primaerschluessel der Tabelle ist, muesste doch eigentlich Unique=True
sein, oder?

Ich gebe zu, ich bin kein ADO.NET-Experte. Es kann also durchaus sein,
dass ich hier falsch liege.
Oliver Sturm
--
http://www.sturmnet.org/blog
Dec 12 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: jagg | last post by:
Hi, i save junior football results in a mysql table (FIELDS id jugend autor sptag ergebnis spdatum zeit ) With the following lines I generate a site whichs gives me ALL results Code:...
2
by: nanookfan | last post by:
Hi all, I'm having a bizarre problem converting XML files to HTML using an XSLT. The problem is only occuring in my Netscape 7.0 browser. What makes it more bizarre is that it is only...
5
by: Clifford W. Racz | last post by:
Has anyone solved the issue of translating lists in Word 2003 (WordML) into xHTML? I have been trying to get the nested table code for my XSLT to work for a while now, with no way to get the...
4
by: Andrew Poulos | last post by:
If I use this code to maximise a browser window: window.moveTo(0,0); window.resizeTo(screen.width,screen.height); it works but on Windows the user can have a taskbar visible and the browser...
1
by: Ingo Kollesch | last post by:
Moin, gibt es eine DB2 Funktion/Abfrage oder View um die User/User Group abzufragen? Ich möchte in meiner Anwendung abfragen ob der eingeloggte User bestimmte Rechte auf der Datenbank hat. Kann...
1
by: simpson | last post by:
Wie kann ich eine Abfrage erzeugen,die unten aufgeführtes Abfrageergebnis erzeugt? Tabelle A: 1. Hund 2. Hund 3. Hund 4. Katze 5. Katze 6. Vogel
0
by: Matthias Jürgens | last post by:
Ich habe eine Datenbank die vorher komplett in Access war. Jetzt habe ich die Tabellen von Access auf SQL-Server portiert und in die Access-Datenbank als Frontend verknüpft. Jetzt habe ich...
20
by: Development - multi.art.studio | last post by:
Hello everyone, i just upgraded my old postgres-database from version 7.1 to 7.4.2. i dumped out my 7.1 database (with pg_dump from 7.1) as an sql-file with copy-commands and to one file using...
0
by: dvgg | last post by:
Hallo! Ich erhalte bei Abfrage eines Webservices folgende Fehlermeldung: ****************************************** <b>Fatal error</b>: Uncaught SoapFault exception: SOAP-ERROR: Encoding:...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.