<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>DataSet hell - &amp;quot;Failed to enable constraints. One or more rows  contain values....&amp;quot;</title><link>http://weblogs.asp.net/rosherove/archive/2004/10/03/DataSet-hell-_2D00_-_2200_Failed-to-enable-constraints.-One-or-more-rows--contain-values_2E002E002E002E002200_.aspx</link><description>A friend asks: When I fill my dataset I get this: &amp;quot; Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.&amp;quot; As you can see, &amp;quot;one or more&amp;quot; is not very informative. How do</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Failed to enable constraints. One or more rows  contain values violating non-null, unique, or foreign-key  constraints.</title><link>http://weblogs.asp.net/rosherove/archive/2004/10/03/DataSet-hell-_2D00_-_2200_Failed-to-enable-constraints.-One-or-more-rows--contain-values_2E002E002E002E002200_.aspx#6896931</link><pubDate>Tue, 10 Feb 2009 16:47:17 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6896931</guid><dc:creator>Failed to enable constraints. One or more rows  contain values violating non-null, unique, or foreign-key  constraints.</dc:creator><author>Failed to enable constraints. One or more rows  contain values violating non-null, unique, or foreign-key  constraints.</author><description>&lt;p&gt;Pingback from &amp;nbsp;Failed to enable constraints. One or more rows &amp;nbsp;contain values violating non-null, unique, or foreign-key &amp;nbsp;constraints.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6896931" width="1" height="1"&gt;</description></item><item><title>nateirwin.net  &amp;raquo; Blog Archive   &amp;raquo; ASP.NET DataSet Error: &amp;quot;Failed to enable constraints. One or more rows&amp;#8230;&amp;quot;</title><link>http://weblogs.asp.net/rosherove/archive/2004/10/03/DataSet-hell-_2D00_-_2200_Failed-to-enable-constraints.-One-or-more-rows--contain-values_2E002E002E002E002200_.aspx#6716239</link><pubDate>Sun, 02 Nov 2008 19:47:53 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6716239</guid><dc:creator>nateirwin.net  » Blog Archive   » ASP.NET DataSet Error: "Failed to enable constraints. One or more rows…"</dc:creator><author>nateirwin.net  » Blog Archive   » ASP.NET DataSet Error: "Failed to enable constraints. One or more rows…"</author><description>&lt;p&gt;Pingback from &amp;nbsp;nateirwin.net &amp;nbsp;&amp;amp;raquo; Blog Archive &amp;nbsp; &amp;amp;raquo; ASP.NET DataSet Error: &amp;amp;quot;Failed to enable constraints. One or more rows&amp;amp;#8230;&amp;amp;quot;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6716239" width="1" height="1"&gt;</description></item><item><title>Programming Links Of The Day, 3/24 &amp;laquo; 36 Chambers - The Legendary Journeys</title><link>http://weblogs.asp.net/rosherove/archive/2004/10/03/DataSet-hell-_2D00_-_2200_Failed-to-enable-constraints.-One-or-more-rows--contain-values_2E002E002E002E002200_.aspx#6021084</link><pubDate>Tue, 25 Mar 2008 00:01:02 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6021084</guid><dc:creator>Programming Links Of The Day, 3/24 « 36 Chambers - The Legendary Journeys</dc:creator><author>Programming Links Of The Day, 3/24 « 36 Chambers - The Legendary Journeys</author><description>&lt;p&gt;Pingback from &amp;nbsp;Programming Links Of The Day, 3/24 &amp;amp;laquo; 36 Chambers - The Legendary Journeys&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6021084" width="1" height="1"&gt;</description></item><item><title>My top 21 Most Viewed Blog posts</title><link>http://weblogs.asp.net/rosherove/archive/2004/10/03/DataSet-hell-_2D00_-_2200_Failed-to-enable-constraints.-One-or-more-rows--contain-values_2E002E002E002E002200_.aspx#5868914</link><pubDate>Wed, 27 Feb 2008 08:52:20 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5868914</guid><dc:creator>Community Blogs</dc:creator><author>Community Blogs</author><description>&lt;p&gt;Here are the top 21 viewed pages on my blog in the past year and a half: Essential Software to install&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5868914" width="1" height="1"&gt;</description></item><item><title>DataSet Constraint Error</title><link>http://weblogs.asp.net/rosherove/archive/2004/10/03/DataSet-hell-_2D00_-_2200_Failed-to-enable-constraints.-One-or-more-rows--contain-values_2E002E002E002E002200_.aspx#4087806</link><pubDate>Mon, 24 Sep 2007 02:11:40 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:4087806</guid><dc:creator>Brian Mains Blog</dc:creator><author>Brian Mains Blog</author><description>&lt;p&gt;I was dealing with an error about &amp;amp;quot;Failing to enable constraints&amp;amp;quot;. I was just added to this&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=4087806" width="1" height="1"&gt;</description></item><item><title>&amp;raquo; First rule of blogging: Enable Anonymous Comments Community Hacker - Creating online communities and blogs, By Roy Osherove</title><link>http://weblogs.asp.net/rosherove/archive/2004/10/03/DataSet-hell-_2D00_-_2200_Failed-to-enable-constraints.-One-or-more-rows--contain-values_2E002E002E002E002200_.aspx#3255431</link><pubDate>Mon, 23 Jul 2007 11:22:27 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:3255431</guid><dc:creator>» First rule of blogging: Enable Anonymous Comments Community Hacker - Creating online communities and blogs, By Roy Osherove</dc:creator><author>» First rule of blogging: Enable Anonymous Comments Community Hacker - Creating online communities and blogs, By Roy Osherove</author><description>&lt;p&gt;Pingback from &amp;nbsp;&amp;amp;raquo; First rule of blogging: Enable Anonymous Comments Community Hacker - Creating online communities and blogs, By Roy Osherove&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=3255431" width="1" height="1"&gt;</description></item><item><title>re: DataSet hell - "Failed to enable constraints. One or more rows  contain values...."</title><link>http://weblogs.asp.net/rosherove/archive/2004/10/03/DataSet-hell-_2D00_-_2200_Failed-to-enable-constraints.-One-or-more-rows--contain-values_2E002E002E002E002200_.aspx#2268686</link><pubDate>Wed, 18 Apr 2007 04:04:41 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:2268686</guid><dc:creator>Juan</dc:creator><author>Juan</author><description>&lt;p&gt;Joel solution suited for me. Basically another developer changed the size of the column and when i did refresh schema the XSD didnt get refreshed as well. I went to check column by column and comparing it with my database and fix it up. Now all is cool. Thanks dude&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2268686" width="1" height="1"&gt;</description></item><item><title>re: DataSet hell - "Failed to enable constraints. One or more rows  contain values...."</title><link>http://weblogs.asp.net/rosherove/archive/2004/10/03/DataSet-hell-_2D00_-_2200_Failed-to-enable-constraints.-One-or-more-rows--contain-values_2E002E002E002E002200_.aspx#2213280</link><pubDate>Wed, 11 Apr 2007 16:18:12 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:2213280</guid><dc:creator>Ed Giardina</dc:creator><author>Ed Giardina</author><description>&lt;p&gt;With regards to Darren Wainwright's comments, its because you have a mismatch between the TableAdapter and the specific query with regards to the amount of columns. If your TableAdapter is defined as &lt;/p&gt;
&lt;p&gt;Select * FROM table_a &lt;/p&gt;
&lt;p&gt;and your specific Fill Method/Get Method / Query is&lt;/p&gt;
&lt;p&gt;SELECT field1 FROM table_a&lt;/p&gt;
&lt;p&gt;or &lt;/p&gt;
&lt;p&gt;SELECT DISTINCT field1 FROM table_a &lt;/p&gt;
&lt;p&gt;and table_a has more than one column,for instance, the exception will be thrown. I saw this by 'previewing' the data with the designer. (Right click on the Query in the designer, and choose preview). The fields not listed in the query were empty, and that's what the exception is barking about. The TableAdapter Query must have the same columns as the individual Queries attached to it.&lt;/p&gt;
&lt;p&gt;It makes sense, if you think about it. The Fill/Get method of the TableAdapter is really creating a specific type of DataSet, and if you're missing fields, the binding doesn't work properly.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2213280" width="1" height="1"&gt;</description></item><item><title>re: DataSet hell - "Failed to enable constraints. One or more rows  contain values...."</title><link>http://weblogs.asp.net/rosherove/archive/2004/10/03/DataSet-hell-_2D00_-_2200_Failed-to-enable-constraints.-One-or-more-rows--contain-values_2E002E002E002E002200_.aspx#2151050</link><pubDate>Fri, 30 Mar 2007 18:05:58 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:2151050</guid><dc:creator>iHateSTDs</dc:creator><author>iHateSTDs</author><description>&lt;p&gt;I had a get statement that would not work with the schema of my table adaptor....after hours of insanity I decided to just add another table adapter based on the query I wanted to use (without the where clause), then added a select query with the where clause to the new table adapter. &lt;/p&gt;
&lt;p&gt;On my aspx page dropped in a new ObjectDataSource to use the new tableadaptor and it worked like a charm. &lt;/p&gt;
&lt;p&gt;For now on I will create seperate table adaptors for complex select queries.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2151050" width="1" height="1"&gt;</description></item><item><title>re: DataSet hell - "Failed to enable constraints. One or more rows  contain values...."</title><link>http://weblogs.asp.net/rosherove/archive/2004/10/03/DataSet-hell-_2D00_-_2200_Failed-to-enable-constraints.-One-or-more-rows--contain-values_2E002E002E002E002200_.aspx#2069240</link><pubDate>Tue, 20 Mar 2007 17:33:07 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:2069240</guid><dc:creator>Dennis Alzoubi</dc:creator><author>Dennis Alzoubi</author><description>&lt;p&gt;I've got that error when I was using the strongly typed dataset, the solution that worked for me is that I've added &amp;quot;Distinct&amp;quot; keyword in the stored procedures that combine two or more tables in the returned final results while defining a primary key in the dataset.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=2069240" width="1" height="1"&gt;</description></item></channel></rss>