[Mono-list] [PATCH] Patch for SqlCommandBuilder and two questions about SqlCommandBuilder class.

Carlos Guzmán Álvarez carlosga@telefonica.net
Tue, 10 Dec 2002 10:40:18 +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 Update 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 )




Two final questions:

1. 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];


2. I think that this line :

	e.Status = UpdateStatus.SkipCurrentRow;
on:

	private void RowUpdatingHandler (object sender, SqlRowUpdatingEventArgs e)


is not correct, because it makes te line to be not updated, it will be:

	e.Status = UpdateStatus.Continue;



¿¿I´m rigth??


Best regards
Carlos Guzmán Álvarez
Vigo-Spain


_______________________________________________
Mono-list maillist  -  Mono-list@ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list