[pgsqlclient-checkins] pgsqlclient_10/PostgreSql.Data.PgSqlClient/source PgCommand.cs,1.30,1.31 PgCo
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2004-03-08 16:39:57
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20814 Modified Files: PgCommand.cs PgCommandBuilder.cs Log Message: 2004-03-08 Carlos Guzman Alvarez <car...@te...> * PostgreSql.Data.PgSqlClient/PgCommandBuilder.cs: - Cleanup. * PostgreSql.Data.PgSqlClient/PgCommand.cs: - Fixed bug. Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** PgCommand.cs 6 Mar 2004 14:50:56 -0000 1.30 --- PgCommand.cs 8 Mar 2004 16:23:25 -0000 1.31 *************** *** 728,731 **** --- 728,732 ---- { this.matchReplaces.Clear(); + this.matchIndex = 0; string pattern = @"(('[^']*?\@[^']*')*[^'@]*?)*(?<param>@\w+)*([^'@]*?('[^']*?\@*[^']*'))*"; Index: PgCommandBuilder.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommandBuilder.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PgCommandBuilder.cs 8 Mar 2004 15:12:26 -0000 1.17 --- PgCommandBuilder.cs 8 Mar 2004 16:23:25 -0000 1.18 *************** *** 107,113 **** get { ! if (dataAdapter.SelectCommand != null) { ! return dataAdapter.SelectCommand; } --- 107,113 ---- get { ! if (this.dataAdapter.SelectCommand != null) { ! return this.dataAdapter.SelectCommand; } *************** *** 229,244 **** public PgCommand GetInsertCommand() { ! if (insertCommand == null) { bool mustClose = false; try { ! if (dataAdapter.SelectCommand.Connection.State == ConnectionState.Closed) { mustClose = true; ! dataAdapter.SelectCommand.Connection.Open(); } ! buildInsertCommand(null, null); } catch (Exception ex) --- 229,244 ---- public PgCommand GetInsertCommand() { ! if (this.insertCommand == null) { bool mustClose = false; try { ! if (this.selectCommand.Connection.State == ConnectionState.Closed) { mustClose = true; ! this.selectCommand.Connection.Open(); } ! this.buildInsertCommand(null, null); } catch (Exception ex) *************** *** 250,254 **** if (mustClose) { ! dataAdapter.SelectCommand.Connection.Close(); } } --- 250,254 ---- if (mustClose) { ! this.selectCommand.Connection.Close(); } } *************** *** 260,275 **** public PgCommand GetUpdateCommand() { ! if (updateCommand == null) { bool mustClose = false; try { ! if (dataAdapter.SelectCommand.Connection.State == ConnectionState.Closed) { mustClose = true; ! dataAdapter.SelectCommand.Connection.Open(); } ! buildUpdateCommand(null, null); } catch (Exception ex) --- 260,275 ---- public PgCommand GetUpdateCommand() { ! if (this.updateCommand == null) { bool mustClose = false; try { ! if (this.selectCommand.Connection.State == ConnectionState.Closed) { mustClose = true; ! this.selectCommand.Connection.Open(); } ! this.buildUpdateCommand(null, null); } catch (Exception ex) *************** *** 281,285 **** if (mustClose) { ! dataAdapter.SelectCommand.Connection.Close(); } } --- 281,285 ---- if (mustClose) { ! this.selectCommand.Connection.Close(); } } *************** *** 296,306 **** try { ! if (dataAdapter.SelectCommand.Connection.State == ConnectionState.Closed) { mustClose = true; ! dataAdapter.SelectCommand.Connection.Open(); } ! buildDeleteCommand(null, null); } catch (Exception ex) --- 296,306 ---- try { ! if (this.selectCommand.Connection.State == ConnectionState.Closed) { mustClose = true; ! this.selectCommand.Connection.Open(); } ! this.buildDeleteCommand(null, null); } catch (Exception ex) *************** *** 312,316 **** if (mustClose) { ! dataAdapter.SelectCommand.Connection.Close(); } } --- 312,316 ---- if (mustClose) { ! this.selectCommand.Connection.Close(); } } *************** *** 339,343 **** string dsColumnName = String.Empty; ! buildSchemaTable(); insertCommand = new PgCommand(sql.ToString(), selectCommand.Connection, selectCommand.Transaction); --- 339,343 ---- string dsColumnName = String.Empty; ! this.buildSchemaTable(); insertCommand = new PgCommand(sql.ToString(), selectCommand.Connection, selectCommand.Transaction); *************** *** 697,701 **** #endregion ! #region Event Handler MEthods private void rowUpdatingHandler(object sender, PgRowUpdatingEventArgs e) --- 697,701 ---- #endregion ! #region Event Handler Methods private void rowUpdatingHandler(object sender, PgRowUpdatingEventArgs e) *************** *** 730,757 **** { case StatementType.Insert: ! if (e.Command == null) ! { ! insertCommand = buildInsertCommand(e.Row, e.TableMapping); ! e.Command = insertCommand; ! } ! e.Status = UpdateStatus.Continue; break; case StatementType.Update: ! if (e.Command == null) ! { ! updateCommand = buildUpdateCommand(e.Row, e.TableMapping); ! e.Command = updateCommand; ! } ! e.Status = UpdateStatus.Continue; break; case StatementType.Delete: ! if (e.Command == null) ! { ! deleteCommand = buildDeleteCommand(e.Row, e.TableMapping); ! e.Command = deleteCommand; ! } ! e.Status = UpdateStatus.Continue; break; } --- 730,742 ---- { case StatementType.Insert: ! e.Command = this.buildInsertCommand(e.Row, e.TableMapping); break; case StatementType.Update: ! e.Command = this.buildUpdateCommand(e.Row, e.TableMapping); break; case StatementType.Delete: ! e.Command = this.buildDeleteCommand(e.Row, e.TableMapping); break; } *************** *** 766,770 **** if (mustClose) { ! dataAdapter.SelectCommand.Connection.Close(); } } --- 751,755 ---- if (mustClose) { ! this.dataAdapter.SelectCommand.Connection.Close(); } } |