[pgsqlclient-checkins] pgsqlclient_10/PostgreSql.Data.PgSqlClient/source PgCommand.cs,1.29,1.30 PgDa
Status: Inactive
Brought to you by:
carlosga_fb
From: <car...@us...> - 2004-03-06 15:05:51
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2788 Modified Files: PgCommand.cs PgDataReader.cs Log Message: 2004-03-06 Carlos Guzman Alvarez <car...@te...> * source/PgCommand.cs: * source/PgDataReader.cs: - Improved Records Affected handling. Index: PgCommand.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** PgCommand.cs 5 Mar 2004 23:38:14 -0000 1.29 --- PgCommand.cs 6 Mar 2004 14:50:56 -0000 1.30 *************** *** 191,194 **** --- 191,198 ---- } + #endregion + + #region Internal Properties + internal CommandBehavior CommandBehavior { *************** *** 201,204 **** --- 205,220 ---- } + internal int RecordsAffected + { + get + { + if (this.statement != null) + { + return this.statement.RecordsAffected; + } + return -1; + } + } + internal bool IsDisposed { *************** *** 571,575 **** bool returnValue = false; ! if (commandBehavior != CommandBehavior.SingleResult) { this.actualCommand++; --- 587,596 ---- bool returnValue = false; ! this.statement.Close(); ! this.statement.ClosePortal(); ! this.statement = null; ! ! if ((this.commandBehavior & CommandBehavior.SingleResult) == CommandBehavior.SingleResult || ! this.commandBehavior == System.Data.CommandBehavior.Default) { this.actualCommand++; *************** *** 585,592 **** if (commandText != null && commandText.Trim().Length > 0) { - this.statement.Close(); - this.statement.ClosePortal(); - this.statement = null; - this.InternalPrepare(); this.InternalExecute(); --- 606,609 ---- Index: PgDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataReader.cs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PgDataReader.cs 9 Feb 2004 14:19:22 -0000 1.17 --- PgDataReader.cs 6 Mar 2004 14:50:56 -0000 1.18 *************** *** 817,826 **** private void updateRecordsAffected() { ! if (command != null && !command.IsDisposed) { ! if (command.Statement.RecordsAffected != -1) { ! recordsAffected = recordsAffected == -1 ? 0 : recordsAffected; ! recordsAffected += command.Statement.RecordsAffected; } } --- 817,827 ---- private void updateRecordsAffected() { ! if (this.command != null && !this.command.IsDisposed) { ! if (this.command.RecordsAffected != -1) { ! this.recordsAffected = ! this.recordsAffected == -1 ? 0 : this.recordsAffected; ! this.recordsAffected += this.command.RecordsAffected; } } *************** *** 829,840 **** private bool cultureAwareCompare(string strA, string strB) { ! try ! { ! return CultureInfo.CurrentCulture.CompareInfo.Compare(strA, strB, CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | CompareOptions.IgnoreCase) == 0 ? true : false; ! } ! catch (Exception) ! { ! return strA.ToUpper() == strB.ToUpper() ? true : false; ! } } --- 830,838 ---- private bool cultureAwareCompare(string strA, string strB) { ! return CultureInfo.CurrentCulture.CompareInfo.Compare( ! strA, ! strB, ! CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | ! CompareOptions.IgnoreCase) == 0 ? true : false; } |