473,512 Members | 15,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Unique constraint violation when Filling a Dataset

I am using Visual Studio to create a VB .NET application to run on
Windows 2000. I am trying to display data from a Sybase ASA table in a
form, allow the user to update the data in the form, and then update the
Sybase table.

I created a OleDbDataAdapter using the wizard. The SQL I used was to
select all the data (2 columns) from one table. I then generated a
dataset with the one table. Then I click on "preview data" and then
"Fill Dataset", and I get the error "Failed to enable constraints. One
or more rows contain values violating non-null, unique, or foreign-key
constraints". It gives me the data in a grid, but the columns
DBCOLUMN_IDNAME and DBCOLUMN_GUID have nulls. The actual table's
columns has data.

I have the same problem no matter what table I put in the Data Adapter,
however when the Sybase table has more columns, there are more of the
DBCOLUMN... columns.

I'm at a loss as to where to being in determining the problem. Thanks
for any help.

Hugh Barnett
National Spinning Company

Nov 21 '05 #1
1 3626
Hugh,

I don't see the answer on your question related to normal use what should
give no problem the way you do it, maybe it has something to do with a
special kind of use in Sybase.

Therefore I think it is good to ask this question also in the newsgroup
microsoft.public.dotnet.framework.adonet

I hope you find your solution

Cor

"Hugh Barnett"
...
I am using Visual Studio to create a VB .NET application to run on Windows
2000. I am trying to display data from a Sybase ASA table in a form, allow
the user to update the data in the form, and then update the Sybase table.

I created a OleDbDataAdapter using the wizard. The SQL I used was to
select all the data (2 columns) from one table. I then generated a
dataset with the one table. Then I click on "preview data" and then "Fill
Dataset", and I get the error "Failed to enable constraints. One or more
rows contain values violating non-null, unique, or foreign-key
constraints". It gives me the data in a grid, but the columns
DBCOLUMN_IDNAME and DBCOLUMN_GUID have nulls. The actual table's columns
has data.

I have the same problem no matter what table I put in the Data Adapter,
however when the Sybase table has more columns, there are more of the
DBCOLUMN... columns.

I'm at a loss as to where to being in determining the problem. Thanks for
any help.

Hugh Barnett
National Spinning Company

Nov 21 '05 #2

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

Similar topics

26
45375
by: Agoston Bejo | last post by:
I want to enforce such a constraint on a column that would ensure that the values be all unique, but this wouldn't apply to NULL values. (I.e. there may be more than one NULL value in the column.)...
4
1362
by: Joăo Santa Bárbara | last post by:
Hi all i have a problem with my sql dataadapter, i think. i have this table below ( Script ) and this table has one particularity, it has 2 unique constraints. when i´m filling my datatable...
7
6650
by: Brian Keating | last post by:
Hi there, Is it possible to add a unique constraint on two columns in a table, so that the constraint is a composite of the two? i.e. these two columns together should be unique...? i.e....
2
6532
by: D. Dante Lorenso | last post by:
I'm trying to build a table that will store a history of records by enumerating the records. I want the newest record to always be number ZERO, so I created a trigger on my table to handle the...
3
10058
by: Bruce Wood | last post by:
I know that this isn't a C# question, but I can't find a newsgroup specifically devoted to ADO.NET, other than a moribund one that deals with ADO in general. This problem is driving me to...
10
3220
by: Phil Latio | last post by:
I am inserting data into user table which contains 5 fields, sounds simple enough normally but 2 of the fields are designated as UNIQUE. If someone does enter a value which already exists, how do I...
1
2653
by: Luqman | last post by:
I have created a form using single Table which has customerId and companyName field, using Typed Dataset. Now, if I click on Delete Button of Binding Navigator, the Customer Record is deleted...
2
15041
by: rorajoey | last post by:
Violation of UNIQUE KEY constraint 'IX_surveyQuestions'. Cannot insert duplicate key in object 'dbo.surveyQuestions'. This might seem like a simple matter of trying to insert a row with ID=20 when...
1
3675
by: crichard1983 | last post by:
I'm using a Unique Key constraint for the first time, and I think I may not be understanding something correctly. I have a table with a Primary key (media_format_id) that is auto-increment. Then I...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.