Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relax or turn off constraints in your dataset

Status
Not open for further replies.

Tim8w

Programmer
Apr 8, 2003
44
0
0
US
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...

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

My Primary Key is called ShippingID. Any help would be appreciated...
 
Sorry,
Figured it out. I removed all the queries from the TableAdapter and started fresh with my Query. Worked correctly...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top