Issue Filling a Dataset
-
Monday, September 24, 2012 11:22 PM
I'm writing a fairly simple program that uses a third-party (DevExpress) control to create and display a report. Previously this code worked fine, but apparently some data was added which threw a monkey wrench in the cogs:
Dim report As New xrptTrendsControlling Dim connSQL As New SqlConnection() connSQL = GetSQLConnection() Dim strQuery As String = "SELECT * FROM qryReportTrendsControlling WHERE UProj_Report='True'" Dim daReport As New SqlDataAdapter(strQuery, connSQL) Dim dsReport As New DataSet dsReport.EnforceConstraints = False daReport.Fill(dsReport, "tblReport") dsReport.EnforceConstraints = False 'report.DataAdapter = daReport ' report.DataAdapter report.DataSource = dsReport.Tables(0) xtraReportPrinter.PrintingSystem = report.PrintingSystem xtraReportPrinter.Show() report.CreateDocument()At the final like the program fails with this error: "Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints."
I've done some research on this, and made some changes so that all the values returned by the dataset include a unique ID, and no data that shouldn't be NULL is. Additionally, I added the line in the code above:
dsReport.EnforceConstraints = False
Unfortunately, none of these have fixed my issue.
Does anyone have any ideas? Why is nothing I try fixing this problem? I've already checked out the DevExpress forums, and they're saying that this is a data/VB.NET issue, nothing on their side.
Thank you!
Dustin
- Edited by Dustin Ventin Friday, September 28, 2012 4:05 PM
All Replies
-
Tuesday, September 25, 2012 3:48 AM
Dustin,
I'm a big advocate of Dev and one of the greatest things about them is their excellent support.
Log in and ask them a question - you'll have a reply back with a qualified answer in, my bet, under 24 hours. They're fantastic about that!
I've only ever set up report(s) using a TableAdapter so I'm out of my element to make a suggestion but they'll know!
Good luck on it. :)
Please call me Frank :)
- Proposed As Answer by Cor LigthertMVP Tuesday, September 25, 2012 5:23 AM
- Marked As Answer by Shanks ZenMicrosoft Contingent Staff, Moderator Tuesday, October 02, 2012 7:14 AM
-
Tuesday, September 25, 2012 5:25 AM
I agree with Frank, but why do you not use in this report case
Dim strQuery As String = "SELECT VA_ID, UProj_Name, etc ........... FROM qryReportTrendsControlling WHERE UProj_Report='True'"
Success
Cor -
Tuesday, September 25, 2012 3:37 PMWow! Extremely excellent.
Pl. Mark/Proposed as Answer if found your solution Vote as Helpful if related to your topic. Always Motivate others by performing this Action.

