I have constraints over currency field that negative value is not acceptable. Constraints is all working fine and I am getting error when constraints violated as per below.
Unable to update row. Reason: The UPDATE statement conflicted with the CHECK constraint "CK_Product_StandardCost". The conflict occurred in database "AdventureWorksLT", table "SalesLT.Product", column 'StandardCost'. The statement has been terminated.
I am getting this error in catch block because I am updating incorrect data in table.
What I want is to get Column name on particular this constraint fires. Here it would be : StandardCost. Is there any way that I can find column name in my C# code?