[Mono-devel-list] Re: [Mono-patches] r45854 - trunk/mcs/class/System.Data/System.Data

Boris Kirzner borisk at mainsoft.com
Tue Jun 14 09:57:04 EDT 2005


Hello Suresh
I'm not sure this particular fix is correct : for the case that 
dataset.EnforceConstraints is false, but datatable.EnforceConstraints is 
true we still should check for possible constraint violation.

Thanks,
Boris

suresh <sthangavel at novell.com> wrote:

>	* ForeignKeyConstraint.cs: IsConstraintViolated: should not check
>	if EnforceConstraints is false.
>
>
>Modified: trunk/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs
>===================================================================
>--- trunk/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs	2005-06-13 05:55:17 UTC (rev 45853)
>+++ trunk/mcs/class/System.Data/System.Data/ForeignKeyConstraint.cs	2005-06-13 06:24:28 UTC (rev 45854)
>@@ -475,7 +475,11 @@
> 		
> 		protected override bool IsConstraintViolated()
> 		{
>-			if (Table.DataSet == null || RelatedTable.DataSet == null) return false; //	
>+			if (Table.DataSet == null || RelatedTable.DataSet == null) 
>+				return false;
>+			
>+			if (!Table.DataSet.EnforceConstraints)
>+				return false;
> 				
> 			bool hasErrors = false;
> 			foreach (DataRow row in Table.Rows) {
>  
>
-- 
Boris Kirzner
Mainsoft Corporation
http://www.mainsoft.com




More information about the Mono-devel-list mailing list