Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. RRS feed

  • Question

  • Hi,

    I'm using report viewer in windows form application to show the data  of a student from multiple tables. I've checked the query using query builder to show the data and it works. But when I'm using the same query while binding with the report.rdlc and report viewer it gives me the error while generating the report. Here in the following is my query and error that I'm facing.


    SELECT        tblStudent.stdRNo, tblStudent.stdName, tblStudent.stdFName, tblInstallments.DueOn, tblInstallments.submitted, tblInstallments.feeParInst, tblClasses.className,                      tblClasses.departName, tblInstallments.InstId FROM            (((tblStudent INNER JOIN                      tblInstallments ON tblStudent.stdRNo = tblInstallments.stdId) INNER JOIN
                             tblFee ON tblStudent.stdRNo = tblFee.stdID AND tblInstallments.stdId = tblFee.stdID) INNER JOIN
                             tblClasses ON tblStudent.stdRNo = tblClasses.stdId)
    WHERE        (tblStudent.stdRNo = ?) AND (tblClasses.departName = ?) AND (tblClasses.className = ?)


    Please let me know if I'm doing something wrong, which is obvious?

    • Moved by Barry Wang Monday, August 25, 2014 6:11 AM RDLC related
    Sunday, August 24, 2014 10:42 AM