Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataSet Problem

Status
Not open for further replies.

netangel

Programmer
Feb 7, 2002
124
PT
I'm having a strange problem with auto generated datasets.

I'm using a Sybase database. I have a design time dataadapter, with a simple select statment, and then I generate the dataset. All goes Ok.

When I run my app, I get a 'Failed to enable constraints' error, on the MyDataAdapter.Fill(MyDataSet).

The select statment is correct, I have a primary key defined on both the database and dataset.

The full error is:
'Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.'

The primary key has no null values, nor non-unique. I have no foreign-keys.

I've had a similar problem on a VB.NET app, with different tables, and different database engines.
Is this a problem with .NET design time datasets? Is there a solution?

Any ideas?

NetAngel
 
Check the incoming data. It sounds to me like the data your select is pulling in has a duplicate in it. That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
The incoming data is perfect. I can load it to a datagrid and I have no duplicated rows or key values, nor null. I believe this is a data set generation bug.
NetAngel
 
You could try printing the schema of the dataset, just to see if it is messed up. I am not to sure what the problem is as I haven't ever ran across it. Sorry That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top