[Mono-list] [PATCH] Patch for SqlCommandBuilder.cs

Carlos Guzmán Álvarez carlosga@telefonica.net
Fri, 06 Dec 2002 13:36:35 +0100


Hello:


This patch prevent two things:


	1.- Exception throwing when tableMapping parameter is null on methods:
		
	CreateInsertCommand (DataRow row, DataTableMapping tableMapping)
  	CreateDeleteCommand (DataRow row, DataTableMapping tableMapping)
  	CreateUpdateCommand (DataRow row, DataTableMapping tableMapping)


	2.- Generation of Updated commands with ReadOnly columns, i think this 
patch needs to be extended to Expresion columns too ( i think that field 
that cannot be included on insert commands cannot be included on update 
commands )





A final question in CreateDeleteCommand when a row and a tableMapping 
are passed as parameters the value of a where parameter is :

	parameter.Value = row [dsColumnName, DataRowVersion.Current];


and in CreateUpdateCommand is :

	parameter.Value = row 	[dsColumnName];


Well, i think that value for where parameters need to be original value 
of the column, anything like this:

	parameter.Value = row [dsColumnName, DataRowVersion.Original];


I´m rigth??


Best regards
Carlos Guzmán Álvarez
Vigo-Spain