Quantcast
Channel: Programmers Heaven Forums RSS Feed
Viewing all articles
Browse latest Browse all 2703

Relax or turn off constraints in your dataset

$
0
0
Hi,

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...

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 


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


Viewing all articles
Browse latest Browse all 2703

Trending Articles