By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,353 Members | 1,256 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,353 IT Pros & Developers. It's quick & easy.

asp.net report DbSource

P: n/a
I'm running into a frustrating problem.

ASP.NET 2.0 web application, against SQL'05, I'm trying to run a report
against a 'table provider' (query) that excutes well within SQL MGT studio,
and within the data environment.

However, when the report is executed in a web report viewer, the report
engine comes back with:

An error has occurred during report processing.
Exception has been thrown by the target of an invocation.
Failed to enable constraints. One or more rows contain values violating
non-null, unique, or foreign-key constraints.

Ideas?

Jul 17 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi David,

The query is producing data of a format that is inconsistent with the schema
for the DataTable in which it is being stored for the report.

Check that the DataTable schema allows nulls for nullable columns in the
query output and make sure that your query returns enough result sets and
records
to fill all related tables in the DataSet so that foreign key constraints
are not violated, or just set the DataSet.EnforceConstraints property to
false.

- Dave Sexton

"David L." <Da****@discussions.microsoft.comwrote in message
news:80**********************************@microsof t.com...
I'm running into a frustrating problem.

ASP.NET 2.0 web application, against SQL'05, I'm trying to run a report
against a 'table provider' (query) that excutes well within SQL MGT
studio,
and within the data environment.

However, when the report is executed in a web report viewer, the report
engine comes back with:

An error has occurred during report processing.
Exception has been thrown by the target of an invocation.
Failed to enable constraints. One or more rows contain values violating
non-null, unique, or foreign-key constraints.

Ideas?

Jul 19 '06 #2

P: n/a
Hi Dave

The same query performs just fine in any other consumer. I was able to use
the exact same query with SQL'05 reprting services, and with an asp grid. The
only one breaking is the report viewer.

Also, I was unable to find the location where I can apply the
DataSet.EnforceConstraints in code, can you give me a pointer?

Thanks

"Dave Sexton" wrote:
Hi David,

The query is producing data of a format that is inconsistent with the schema
for the DataTable in which it is being stored for the report.

Check that the DataTable schema allows nulls for nullable columns in the
query output and make sure that your query returns enough result sets and
records
to fill all related tables in the DataSet so that foreign key constraints
are not violated, or just set the DataSet.EnforceConstraints property to
false.

- Dave Sexton

"David L." <Da****@discussions.microsoft.comwrote in message
news:80**********************************@microsof t.com...
I'm running into a frustrating problem.

ASP.NET 2.0 web application, against SQL'05, I'm trying to run a report
against a 'table provider' (query) that excutes well within SQL MGT
studio,
and within the data environment.

However, when the report is executed in a web report viewer, the report
engine comes back with:

An error has occurred during report processing.
Exception has been thrown by the target of an invocation.
Failed to enable constraints. One or more rows contain values violating
non-null, unique, or foreign-key constraints.

Ideas?


Jul 19 '06 #3

P: n/a
Hi David,

Since you can't find the DataSet I must assume that you have configured a
strong-Typed DataSet and associated its TableAdapter with an
ObjectDataSource for your report, correct?

Unfortunately you don't have access to the underlying DataSet until after it
has been created and filled. Your best bet is to try to narrow down which
DataColumn is causing the trouble and fix the schema.

Another option is to bind the ObjectDataSource to a DataSet and fill the
DataSet in your code-beside file. This way, you can set EnforceConstraints
to true, although I really do think you should just fix the schema instead.

- Dave Sexton

"David L." <Da****@discussions.microsoft.comwrote in message
news:FC**********************************@microsof t.com...
Hi Dave

The same query performs just fine in any other consumer. I was able to use
the exact same query with SQL'05 reprting services, and with an asp grid.
The
only one breaking is the report viewer.

Also, I was unable to find the location where I can apply the
DataSet.EnforceConstraints in code, can you give me a pointer?

Thanks

"Dave Sexton" wrote:
>Hi David,

The query is producing data of a format that is inconsistent with the
schema
for the DataTable in which it is being stored for the report.

Check that the DataTable schema allows nulls for nullable columns in the
query output and make sure that your query returns enough result sets and
records
to fill all related tables in the DataSet so that foreign key constraints
are not violated, or just set the DataSet.EnforceConstraints property to
false.

- Dave Sexton

"David L." <Da****@discussions.microsoft.comwrote in message
news:80**********************************@microso ft.com...
I'm running into a frustrating problem.

ASP.NET 2.0 web application, against SQL'05, I'm trying to run a report
against a 'table provider' (query) that excutes well within SQL MGT
studio,
and within the data environment.

However, when the report is executed in a web report viewer, the report
engine comes back with:

An error has occurred during report processing.
Exception has been thrown by the target of an invocation.
Failed to enable constraints. One or more rows contain values violating
non-null, unique, or foreign-key constraints.

Ideas?



Jul 19 '06 #4

P: n/a
Hi Dave

It's still odd to me that the table adapter fills a grid without a murmur
and failes on the report. And, the base query is used by SQL'05 reporting
services as is without any issues. I believe that there is a bug in the
reporting engine, I wish MS will step in here.

See below

"Dave Sexton" wrote:
Hi David,

Since you can't find the DataSet I must assume that you have configured a
strong-Typed DataSet and associated its TableAdapter with an
ObjectDataSource for your report, correct?
yes
Unfortunately you don't have access to the underlying DataSet until after it
has been created and filled. Your best bet is to try to narrow down which
DataColumn is causing the trouble and fix the schema.
that's the part that stumps me, I looked at the data, there is no issue of
null values, even though, the query does create duplicates of a primary key
from a master list.
Another option is to bind the ObjectDataSource to a DataSet and fill the
DataSet in your code-beside file. This way, you can set EnforceConstraints
to true, although I really do think you should just fix the schema instead.
Thanks, I'll keep this in mind.
- Dave Sexton

"David L." <Da****@discussions.microsoft.comwrote in message
news:FC**********************************@microsof t.com...
Hi Dave

The same query performs just fine in any other consumer. I was able to use
the exact same query with SQL'05 reprting services, and with an asp grid.
The
only one breaking is the report viewer.

Also, I was unable to find the location where I can apply the
DataSet.EnforceConstraints in code, can you give me a pointer?

Thanks

"Dave Sexton" wrote:
Hi David,

The query is producing data of a format that is inconsistent with the
schema
for the DataTable in which it is being stored for the report.

Check that the DataTable schema allows nulls for nullable columns in the
query output and make sure that your query returns enough result sets and
records
to fill all related tables in the DataSet so that foreign key constraints
are not violated, or just set the DataSet.EnforceConstraints property to
false.

- Dave Sexton

"David L." <Da****@discussions.microsoft.comwrote in message
news:80**********************************@microsof t.com...
I'm running into a frustrating problem.

ASP.NET 2.0 web application, against SQL'05, I'm trying to run a report
against a 'table provider' (query) that excutes well within SQL MGT
studio,
and within the data environment.

However, when the report is executed in a web report viewer, the report
engine comes back with:

An error has occurred during report processing.
Exception has been thrown by the target of an invocation.
Failed to enable constraints. One or more rows contain values violating
non-null, unique, or foreign-key constraints.

Ideas?



Jul 19 '06 #5

P: n/a
Hi David,
that's the part that stumps me, I looked at the data, there is no issue of
null values, even though, the query does create duplicates of a primary
key
from a master list.
Well the error is definitely being thrown by the DataSet although it might
not be specific to null values. Is there more than one DataTable in your
DataSet with DataRelations that provide foreign-key constraints? As a
simple test try removing those DataTables from the DataSet that are not
being used in the report.

Duplicate primary keys could very well be the issue here as well if you have
defined a unique constraint on your key column by setting Unique to true in
the .xsd designer or setting the key column as the primary key. Removing
those constraints, if they exist, might solve your problem although you
should probably make a new schema for your report data void of any
constraints that might be causing the error, not only as a test but for
runtime as well.

- Dave Sexton

"David L." <Da****@discussions.microsoft.comwrote in message
news:8D**********************************@microsof t.com...
Hi Dave

It's still odd to me that the table adapter fills a grid without a murmur
and failes on the report. And, the base query is used by SQL'05 reporting
services as is without any issues. I believe that there is a bug in the
reporting engine, I wish MS will step in here.

See below

"Dave Sexton" wrote:
>Hi David,

Since you can't find the DataSet I must assume that you have configured a
strong-Typed DataSet and associated its TableAdapter with an
ObjectDataSource for your report, correct?

yes
>Unfortunately you don't have access to the underlying DataSet until after
it
has been created and filled. Your best bet is to try to narrow down
which
DataColumn is causing the trouble and fix the schema.

that's the part that stumps me, I looked at the data, there is no issue of
null values, even though, the query does create duplicates of a primary
key
from a master list.
>Another option is to bind the ObjectDataSource to a DataSet and fill the
DataSet in your code-beside file. This way, you can set
EnforceConstraints
to true, although I really do think you should just fix the schema
instead.

Thanks, I'll keep this in mind.
>- Dave Sexton

"David L." <Da****@discussions.microsoft.comwrote in message
news:FC**********************************@microso ft.com...
Hi Dave

The same query performs just fine in any other consumer. I was able to
use
the exact same query with SQL'05 reprting services, and with an asp
grid.
The
only one breaking is the report viewer.

Also, I was unable to find the location where I can apply the
DataSet.EnforceConstraints in code, can you give me a pointer?

Thanks

"Dave Sexton" wrote:

Hi David,

The query is producing data of a format that is inconsistent with the
schema
for the DataTable in which it is being stored for the report.

Check that the DataTable schema allows nulls for nullable columns in
the
query output and make sure that your query returns enough result sets
and
records
to fill all related tables in the DataSet so that foreign key
constraints
are not violated, or just set the DataSet.EnforceConstraints property
to
false.

- Dave Sexton

"David L." <Da****@discussions.microsoft.comwrote in message
news:80**********************************@microso ft.com...
I'm running into a frustrating problem.

ASP.NET 2.0 web application, against SQL'05, I'm trying to run a
report
against a 'table provider' (query) that excutes well within SQL MGT
studio,
and within the data environment.

However, when the report is executed in a web report viewer, the
report
engine comes back with:

An error has occurred during report processing.
Exception has been thrown by the target of an invocation.
Failed to enable constraints. One or more rows contain values
violating
non-null, unique, or foreign-key constraints.

Ideas?




Jul 19 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.