Relax or turn off constraints in your dataset


I have created a DataSet in VB.Net. The Table it is connected to has a PrimaryKey. All works fine as long as my SQL Query is a Standard one like SELECT * from....

I want to use a GROUP BY but when I do I get "ConstraintException was unhandled" with the suggestion that I relax or turn off constraints... I can't find a way to do this. I cannot find EnforceConstraints anywhere in the interface to turn it to false...

Here is my GROUP BY which doesn't include the Primary Key value in it anywhere...

[code]SELECT CustomerID, SUM(PPA) AS 'CustomerPay', SUM(ABS) AS 'TechPay', SUM(TaxDuty) AS 'Tax', CustDept
FROM tabShippingItems
WHERE (InvoiceNumber = @InvoiceNumber)
GROUP BY CustomerID, CustDept
ORDER BY CustomerID [/code]

My Primary Key is called ShippingID. Any help would be appreciated...

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!