[pgsqlclient-checkins] pgsqlclient_10/PostgreSql.Data.PgSqlClient/source PgCommand.cs,1.22,1.23 PgCo
Status: Inactive
Brought to you by:
carlosga_fb
Update of /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source
In directory sc8-pr-cvs1:/tmp/cvs-serv15570
Modified Files:
PgCommand.cs PgCommandBuilder.cs PgConnection.cs
PgConnectionPool.cs PgDataAdapter.cs PgDataReader.cs
PgDbConnection.cs PgError.cs PgErrorCollection.cs
PgException.cs PgParameter.cs PgParameterCollection.cs
PgTransaction.cs
Log Message:
2003-12-14 Carlos Guzmán Álvarez <car...@te...>
* Changed #region names in all source files.
Index: PgCommand.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommand.cs,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** PgCommand.cs 6 Dec 2003 12:01:14 -0000 1.22
--- PgCommand.cs 14 Dec 2003 15:06:50 -0000 1.23
***************
*** 1,750 ****
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
[...1471 lines suppressed...]
! int count = 0;
! for (int i = 0; i < matches.Count; i++)
! {
! if (matches[i].Value.Trim() != String.Empty)
! {
! this.commands[count] = matches[i].Value.Trim();
! count++;
! }
! }
! }
! else
! {
! this.commands = new string[]{this.commandText};
! }
! }
! }
!
! #endregion
! }
}
Index: PgCommandBuilder.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgCommandBuilder.cs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** PgCommandBuilder.cs 19 Nov 2003 15:19:19 -0000 1.13
--- PgCommandBuilder.cs 14 Dec 2003 15:06:50 -0000 1.14
***************
*** 1,781 ****
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
[...1533 lines suppressed...]
! e.Status = UpdateStatus.Continue;
! }
! }
! catch (Exception exception)
! {
! e.Errors = exception;
! e.Status = UpdateStatus.ErrorsOccurred;
! }
! finally
! {
! if (mustClose)
! {
! dataAdapter.SelectCommand.Connection.Close();
! }
! }
! }
!
! #endregion
! }
! }
Index: PgConnection.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgConnection.cs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** PgConnection.cs 24 Nov 2003 16:38:58 -0000 1.9
--- PgConnection.cs 14 Dec 2003 15:06:50 -0000 1.10
***************
*** 1,659 ****
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
[...1289 lines suppressed...]
! X509CertificateCollection clientCertificates,
! X509Certificate serverCertificate,
! string targetHost,
! X509CertificateCollection serverRequestedCertificates)
! {
! if (this.ClientCertSelection != null)
! {
! return this.ClientCertSelection(
! clientCertificates,
! serverCertificate,
! targetHost,
! serverRequestedCertificates);
! }
!
! return null;
! }
!
! #endregion
! }
! }
Index: PgConnectionPool.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgConnectionPool.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PgConnectionPool.cs 2 Aug 2003 19:43:00 -0000 1.1.1.1
--- PgConnectionPool.cs 14 Dec 2003 15:06:50 -0000 1.2
***************
*** 1,238 ****
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
! using System.Data;
! using System.Collections;
! using System.Threading;
! using PostgreSql.Data.NPgClient;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! internal class PgConnectionPool : MarshalByRefObject
! {
! #region FIELDS
!
! private static PgPoolManager pool = null;
!
! #endregion
!
! #region METHODS
!
! public static void Initialize()
! {
! if (pool == null)
! {
! pool = new PgPoolManager();
! }
! }
!
! public static PgDbConnection GetConnection(string connectionString)
! {
! Initialize();
!
! return ((PgDbConnection)pool.CheckOut(connectionString));
! }
!
! public static void FreeConnection(PgDbConnection c)
! {
! pool.CheckIn(c);
! }
!
! #endregion
! }
!
! internal class PgPoolManager
! {
! #region FIELDS
!
! private ArrayList locked;
! private ArrayList unlocked;
! private Thread cleanUpThread;
!
! #endregion
!
! #region CONSTRUCTORS
!
! public PgPoolManager()
! {
! locked = ArrayList.Synchronized(new ArrayList());
! unlocked = ArrayList.Synchronized(new ArrayList());
!
! cleanUpThread = new Thread(new ThreadStart(RunCleanUp));
! cleanUpThread.Name = "CleanUp Thread";
! cleanUpThread.Start();
! cleanUpThread.IsBackground = true;
! }
!
! #endregion
!
! #region METHODS
!
! public PgDbConnection CheckOut(string connectionString)
! {
! PgDbConnection newConnection = null;
! long now = System.DateTime.Now.Ticks;
!
! lock (typeof(PgConnectionPool))
! {
! if (unlocked.Count > 0)
! {
! PgDbConnection[] list = new PgDbConnection[unlocked.Count];
! unlocked.CopyTo(0, list, 0, list.Length);
!
! foreach(PgDbConnection connection in list)
! {
! if (Validate(connection, connectionString))
! {
! if (connection.Lifetime != 0)
! {
! if ((now - connection.Created) > connection.Lifetime)
! {
! unlocked.Remove(connection);
! Expire(connection);
! }
! else
! {
! unlocked.Remove(connection);
! locked.Add(connection);
!
! return(connection);
! }
! }
! else
! {
! unlocked.Remove(connection);
! locked.Add(connection);
!
! return(connection);
! }
! }
! else
! {
! unlocked.Remove(connection);
! Expire(connection);
! }
! }
! }
!
! newConnection = Create(connectionString);
! newConnection.Created = System.DateTime.Now.Ticks;
!
! locked.Add(newConnection);
! }
!
! return(newConnection);
! }
!
! public void CheckIn(PgDbConnection connection)
! {
! lock (typeof(PgDbConnection))
! {
! connection.Created = System.DateTime.Now.Ticks;
!
! locked.Remove(connection);
! unlocked.Add(connection);
! }
! }
!
! private void RunCleanUp()
! {
! TimeSpan interval = new TimeSpan(0, 0, 10);
!
! while (true)
! {
! CleanUp(null);
!
! Thread.Sleep(interval);
! }
! }
!
! private PgDbConnection Create(string connectionString)
! {
! try
! {
! PgDbConnection connection = new PgDbConnection(connectionString);
! connection.Connect();
! connection.Pooled = true;
!
! return connection;
! }
! catch (PgClientException ex)
! {
! throw ex;
! }
! }
!
! private bool Validate(PgDbConnection connection, string connectionString)
! {
! try
! {
! return (connection.ConnectionString == connectionString &&
! connection.VerifyConnection());
! }
! catch (Exception ex)
! {
! throw ex;
! }
! }
!
! private void Expire(PgDbConnection connection)
! {
! try
! {
! if (connection.VerifyConnection())
! {
! connection.Disconnect();
! }
! }
! catch (Exception)
! {
! throw new PgException("Error closing database connection.");
! }
! }
!
! private void CleanUp(object State)
! {
! long now = System.DateTime.Now.Ticks;
!
! lock (unlocked.SyncRoot)
! {
! if (unlocked.Count > 0)
! {
! PgDbConnection[] list = new PgDbConnection[unlocked.Count];
!
! unlocked.CopyTo(0, list, 0, list.Length);
! foreach (PgDbConnection connection in list)
! {
! if (connection.Lifetime != 0)
! {
! if ((now - connection.Created) > connection.Lifetime)
! {
! unlocked.Remove(connection);
! Expire(connection);
! }
! }
! }
! }
! }
! }
!
! #endregion
! }
! }
--- 1,238 ----
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
! using System.Data;
! using System.Collections;
! using System.Threading;
! using PostgreSql.Data.NPgClient;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! internal class PgConnectionPool : MarshalByRefObject
! {
! #region Fields
!
! private static PgPoolManager pool = null;
!
! #endregion
!
! #region Methods
!
! public static void Initialize()
! {
! if (pool == null)
! {
! pool = new PgPoolManager();
! }
! }
!
! public static PgDbConnection GetConnection(string connectionString)
! {
! Initialize();
!
! return ((PgDbConnection)pool.CheckOut(connectionString));
! }
!
! public static void FreeConnection(PgDbConnection c)
! {
! pool.CheckIn(c);
! }
!
! #endregion
! }
!
! internal class PgPoolManager
! {
! #region Fields
!
! private ArrayList locked;
! private ArrayList unlocked;
! private Thread cleanUpThread;
!
! #endregion
!
! #region Constructors
!
! public PgPoolManager()
! {
! locked = ArrayList.Synchronized(new ArrayList());
! unlocked = ArrayList.Synchronized(new ArrayList());
!
! cleanUpThread = new Thread(new ThreadStart(RunCleanUp));
! cleanUpThread.Name = "CleanUp Thread";
! cleanUpThread.Start();
! cleanUpThread.IsBackground = true;
! }
!
! #endregion
!
! #region Methods
!
! public PgDbConnection CheckOut(string connectionString)
! {
! PgDbConnection newConnection = null;
! long now = System.DateTime.Now.Ticks;
!
! lock (typeof(PgConnectionPool))
! {
! if (unlocked.Count > 0)
! {
! PgDbConnection[] list = new PgDbConnection[unlocked.Count];
! unlocked.CopyTo(0, list, 0, list.Length);
!
! foreach(PgDbConnection connection in list)
! {
! if (Validate(connection, connectionString))
! {
! if (connection.Lifetime != 0)
! {
! if ((now - connection.Created) > connection.Lifetime)
! {
! unlocked.Remove(connection);
! Expire(connection);
! }
! else
! {
! unlocked.Remove(connection);
! locked.Add(connection);
!
! return(connection);
! }
! }
! else
! {
! unlocked.Remove(connection);
! locked.Add(connection);
!
! return(connection);
! }
! }
! else
! {
! unlocked.Remove(connection);
! Expire(connection);
! }
! }
! }
!
! newConnection = Create(connectionString);
! newConnection.Created = System.DateTime.Now.Ticks;
!
! locked.Add(newConnection);
! }
!
! return(newConnection);
! }
!
! public void CheckIn(PgDbConnection connection)
! {
! lock (typeof(PgDbConnection))
! {
! connection.Created = System.DateTime.Now.Ticks;
!
! locked.Remove(connection);
! unlocked.Add(connection);
! }
! }
!
! private void RunCleanUp()
! {
! TimeSpan interval = new TimeSpan(0, 0, 10);
!
! while (true)
! {
! CleanUp(null);
!
! Thread.Sleep(interval);
! }
! }
!
! private PgDbConnection Create(string connectionString)
! {
! try
! {
! PgDbConnection connection = new PgDbConnection(connectionString);
! connection.Connect();
! connection.Pooled = true;
!
! return connection;
! }
! catch (PgClientException ex)
! {
! throw ex;
! }
! }
!
! private bool Validate(PgDbConnection connection, string connectionString)
! {
! try
! {
! return (connection.ConnectionString == connectionString &&
! connection.VerifyConnection());
! }
! catch (Exception ex)
! {
! throw ex;
! }
! }
!
! private void Expire(PgDbConnection connection)
! {
! try
! {
! if (connection.VerifyConnection())
! {
! connection.Disconnect();
! }
! }
! catch (Exception)
! {
! throw new PgException("Error closing database connection.");
! }
! }
!
! private void CleanUp(object State)
! {
! long now = System.DateTime.Now.Ticks;
!
! lock (unlocked.SyncRoot)
! {
! if (unlocked.Count > 0)
! {
! PgDbConnection[] list = new PgDbConnection[unlocked.Count];
!
! unlocked.CopyTo(0, list, 0, list.Length);
! foreach (PgDbConnection connection in list)
! {
! if (connection.Lifetime != 0)
! {
! if ((now - connection.Created) > connection.Lifetime)
! {
! unlocked.Remove(connection);
! Expire(connection);
! }
! }
! }
! }
! }
! }
!
! #endregion
! }
! }
Index: PgDataAdapter.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataAdapter.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PgDataAdapter.cs 19 Nov 2003 15:19:19 -0000 1.3
--- PgDataAdapter.cs 14 Dec 2003 15:06:50 -0000 1.4
***************
*** 1,223 ****
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
! using System.Data;
! using System.Drawing;
! using System.Data.Common;
! using System.ComponentModel;
! using System.ComponentModel.Design;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! #region DELEGATES
!
! public delegate void PgRowUpdatedEventHandler(object sender, PgRowUpdatedEventArgs e);
! public delegate void PgRowUpdatingEventHandler(object sender, PgRowUpdatingEventArgs e);
!
! #endregion
!
! [ToolboxItem(true),
! ToolboxBitmap(typeof(PgDataAdapter), "Resources.ToolBox.PgDataAdapter.bmp"),
! DefaultEvent("RowUpdated")]
! public sealed class PgDataAdapter : DbDataAdapter, IDbDataAdapter
! {
! #region EVENTS
!
! private static readonly object EventRowUpdated = new object();
! private static readonly object EventRowUpdating = new object();
!
! #endregion
!
! #region FIELDS
!
! private PgCommand selectCommand;
! private PgCommand insertCommand;
! private PgCommand updateCommand;
! private PgCommand deleteCommand;
! private bool disposed;
!
! #endregion
!
! #region PROPERTIES
!
! IDbCommand IDbDataAdapter.SelectCommand
! {
! get { return selectCommand; }
! set { selectCommand = (PgCommand)value; }
! }
!
! IDbCommand IDbDataAdapter.InsertCommand
! {
! get { return insertCommand; }
! set { insertCommand = (PgCommand)value; }
! }
!
! IDbCommand IDbDataAdapter.UpdateCommand
! {
! get { return updateCommand; }
! set { updateCommand = (PgCommand)value; }
! }
!
! IDbCommand IDbDataAdapter.DeleteCommand
! {
! get { return deleteCommand; }
! set { deleteCommand = (PgCommand)value; }
! }
!
! [Category("DataCategory_Update"), DefaultValue(null)]
! public PgCommand SelectCommand
! {
! get { return selectCommand; }
! set { selectCommand = value; }
! }
!
! [Category("DataCategory_Update"), DefaultValue(null)]
! public PgCommand InsertCommand
! {
! get { return insertCommand; }
! set { insertCommand = value; }
! }
!
! [Category("DataCategory_Fill"), DefaultValue(null)]
! public PgCommand UpdateCommand
! {
! get { return updateCommand; }
! set { updateCommand = value; }
! }
!
! [Category("DataCategory_Update"), DefaultValue(null)]
! public PgCommand DeleteCommand
! {
! get { return deleteCommand; }
! set { deleteCommand = value; }
! }
!
! #endregion
!
! #region CONSTRUCTORS
!
! public PgDataAdapter() : base()
! {
! GC.SuppressFinalize(this);
! }
!
! public PgDataAdapter(PgCommand selectCommand) : this()
! {
! this.selectCommand = selectCommand;
! }
!
! public PgDataAdapter(string commandText, PgConnection connection) : this()
! {
! this.selectCommand = new PgCommand(commandText, connection);
! }
!
! public PgDataAdapter(string commandText, string connectionString) : this()
! {
! this.selectCommand = new PgCommand(commandText, new PgConnection(connectionString));
! }
!
! #endregion
!
! #region DISPOSE_METHODS
!
! protected override void Dispose(bool disposing)
! {
! if (!disposed)
! {
! try
! {
! if (disposing)
! {
! if (selectCommand != null)
! {
! selectCommand.Dispose();
! }
! if (insertCommand != null)
! {
! insertCommand.Dispose();
! }
! if (updateCommand != null)
! {
! updateCommand.Dispose();
! }
! }
!
! // release any unmanaged resources
!
! disposed = true;
! }
! finally
! {
! base.Dispose(disposing);
! }
! }
! }
!
! #endregion
!
! #region METHODS
!
! public event PgRowUpdatedEventHandler RowUpdated
! {
! add { Events.AddHandler(EventRowUpdated, value); }
! remove { Events.RemoveHandler(EventRowUpdated, value); }
! }
!
! [Category("DataCategory_Update")]
! public event PgRowUpdatingEventHandler RowUpdating
! {
! add { Events.AddHandler(EventRowUpdating, value); }
! remove { Events.RemoveHandler(EventRowUpdating, value); }
! }
!
! #endregion
!
! #region PROTECTED_METHODS
!
! protected override RowUpdatedEventArgs CreateRowUpdatedEvent(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
! {
! return new PgRowUpdatedEventArgs(dataRow, command, statementType, tableMapping);
! }
!
! protected override void OnRowUpdated(RowUpdatedEventArgs value)
! {
! PgRowUpdatedEventHandler handler = (PgRowUpdatedEventHandler) Events[EventRowUpdated];
! if ((null != handler) && (value is PgRowUpdatedEventArgs))
! {
! handler(this, (PgRowUpdatedEventArgs) value);
! }
! }
!
! protected override RowUpdatingEventArgs CreateRowUpdatingEvent(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
! {
! return new PgRowUpdatingEventArgs(dataRow, command, statementType, tableMapping);
! }
!
! protected override void OnRowUpdating(RowUpdatingEventArgs value)
! {
! PgRowUpdatingEventHandler handler = (PgRowUpdatingEventHandler) Events[EventRowUpdating];
! if ((null != handler) && (value is PgRowUpdatingEventArgs))
! {
! handler(this, (PgRowUpdatingEventArgs) value);
! }
! }
!
! #endregion
! }
! }
--- 1,223 ----
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
! using System.Data;
! using System.Drawing;
! using System.Data.Common;
! using System.ComponentModel;
! using System.ComponentModel.Design;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! #region DELEGATES
!
! public delegate void PgRowUpdatedEventHandler(object sender, PgRowUpdatedEventArgs e);
! public delegate void PgRowUpdatingEventHandler(object sender, PgRowUpdatingEventArgs e);
!
! #endregion
!
! [ToolboxItem(true),
! ToolboxBitmap(typeof(PgDataAdapter), "Resources.ToolBox.PgDataAdapter.bmp"),
! DefaultEvent("RowUpdated")]
! public sealed class PgDataAdapter : DbDataAdapter, IDbDataAdapter
! {
! #region Events
!
! private static readonly object EventRowUpdated = new object();
! private static readonly object EventRowUpdating = new object();
!
! #endregion
!
! #region Fields
!
! private PgCommand selectCommand;
! private PgCommand insertCommand;
! private PgCommand updateCommand;
! private PgCommand deleteCommand;
! private bool disposed;
!
! #endregion
!
! #region Properties
!
! IDbCommand IDbDataAdapter.SelectCommand
! {
! get { return selectCommand; }
! set { selectCommand = (PgCommand)value; }
! }
!
! IDbCommand IDbDataAdapter.InsertCommand
! {
! get { return insertCommand; }
! set { insertCommand = (PgCommand)value; }
! }
!
! IDbCommand IDbDataAdapter.UpdateCommand
! {
! get { return updateCommand; }
! set { updateCommand = (PgCommand)value; }
! }
!
! IDbCommand IDbDataAdapter.DeleteCommand
! {
! get { return deleteCommand; }
! set { deleteCommand = (PgCommand)value; }
! }
!
! [Category("DataCategory_Update"), DefaultValue(null)]
! public PgCommand SelectCommand
! {
! get { return selectCommand; }
! set { selectCommand = value; }
! }
!
! [Category("DataCategory_Update"), DefaultValue(null)]
! public PgCommand InsertCommand
! {
! get { return insertCommand; }
! set { insertCommand = value; }
! }
!
! [Category("DataCategory_Fill"), DefaultValue(null)]
! public PgCommand UpdateCommand
! {
! get { return updateCommand; }
! set { updateCommand = value; }
! }
!
! [Category("DataCategory_Update"), DefaultValue(null)]
! public PgCommand DeleteCommand
! {
! get { return deleteCommand; }
! set { deleteCommand = value; }
! }
!
! #endregion
!
! #region Constructors
!
! public PgDataAdapter() : base()
! {
! GC.SuppressFinalize(this);
! }
!
! public PgDataAdapter(PgCommand selectCommand) : this()
! {
! this.selectCommand = selectCommand;
! }
!
! public PgDataAdapter(string commandText, PgConnection connection) : this()
! {
! this.selectCommand = new PgCommand(commandText, connection);
! }
!
! public PgDataAdapter(string commandText, string connectionString) : this()
! {
! this.selectCommand = new PgCommand(commandText, new PgConnection(connectionString));
! }
!
! #endregion
!
! #region DISPOSE_METHODS
!
! protected override void Dispose(bool disposing)
! {
! if (!disposed)
! {
! try
! {
! if (disposing)
! {
! if (selectCommand != null)
! {
! selectCommand.Dispose();
! }
! if (insertCommand != null)
! {
! insertCommand.Dispose();
! }
! if (updateCommand != null)
! {
! updateCommand.Dispose();
! }
! }
!
! // release any unmanaged resources
!
! disposed = true;
! }
! finally
! {
! base.Dispose(disposing);
! }
! }
! }
!
! #endregion
!
! #region Methods
!
! public event PgRowUpdatedEventHandler RowUpdated
! {
! add { Events.AddHandler(EventRowUpdated, value); }
! remove { Events.RemoveHandler(EventRowUpdated, value); }
! }
!
! [Category("DataCategory_Update")]
! public event PgRowUpdatingEventHandler RowUpdating
! {
! add { Events.AddHandler(EventRowUpdating, value); }
! remove { Events.RemoveHandler(EventRowUpdating, value); }
! }
!
! #endregion
!
! #region Protected Methods
!
! protected override RowUpdatedEventArgs CreateRowUpdatedEvent(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
! {
! return new PgRowUpdatedEventArgs(dataRow, command, statementType, tableMapping);
! }
!
! protected override void OnRowUpdated(RowUpdatedEventArgs value)
! {
! PgRowUpdatedEventHandler handler = (PgRowUpdatedEventHandler) Events[EventRowUpdated];
! if ((null != handler) && (value is PgRowUpdatedEventArgs))
! {
! handler(this, (PgRowUpdatedEventArgs) value);
! }
! }
!
! protected override RowUpdatingEventArgs CreateRowUpdatingEvent(DataRow dataRow, IDbCommand command, StatementType statementType, DataTableMapping tableMapping)
! {
! return new PgRowUpdatingEventArgs(dataRow, command, statementType, tableMapping);
! }
!
! protected override void OnRowUpdating(RowUpdatingEventArgs value)
! {
! PgRowUpdatingEventHandler handler = (PgRowUpdatingEventHandler) Events[EventRowUpdating];
! if ((null != handler) && (value is PgRowUpdatingEventArgs))
! {
! handler(this, (PgRowUpdatingEventArgs) value);
! }
! }
!
! #endregion
! }
! }
Index: PgDataReader.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDataReader.cs,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** PgDataReader.cs 20 Nov 2003 17:34:42 -0000 1.14
--- PgDataReader.cs 14 Dec 2003 15:06:50 -0000 1.15
***************
*** 1,839 ****
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
[...1649 lines suppressed...]
! recordsAffected += command.Statement.RecordsAffected;
! }
! }
! }
!
! 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;
! }
! }
!
! #endregion
! }
}
Index: PgDbConnection.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgDbConnection.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PgDbConnection.cs 9 Oct 2003 15:46:23 -0000 1.3
--- PgDbConnection.cs 14 Dec 2003 15:06:50 -0000 1.4
***************
*** 1,219 ****
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
! using System.Text;
! using System.Collections;
! using System.Text.RegularExpressions;
!
! using PostgreSql.Data.NPgClient;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! internal sealed class PgDbConnection : MarshalByRefObject
! {
! #region FIELDS
!
! private PgDbClient db;
! private string connectionString;
! private PgConnectionParams settings;
! private long created;
! private long lifetime;
! private bool pooled;
! private Regex search;
!
! #endregion
!
! #region PROPERTIES
!
! public PgDbClient DB
! {
! get { return db; }
! }
!
! public string ConnectionString
! {
! get { return connectionString; }
! }
!
! public long Lifetime
! {
! get { return lifetime; }
! }
! public long Created
! {
! get { return created; }
! set { created = value; }
! }
!
! public bool Pooled
! {
! get { return pooled; }
! set { pooled = value; }
! }
!
! public PgConnectionParams Settings
! {
! get { return settings; }
! }
!
! #endregion
!
! #region CONSTRUCTORS
!
! private PgDbConnection()
! {
! settings = new PgConnectionParams();
! search = new Regex(@"([\w\s\d]*)\s*=\s*([^;]*)");
!
! connectionString = String.Empty;
! lifetime = 0;
! created = 0;
! pooled = true;
! }
!
! public PgDbConnection(string connectionString) : this()
! {
! this.connectionString = connectionString;
! parseConnectionString();
! }
!
! #endregion
!
! #region METHODS
!
! public void Connect()
! {
! try
! {
! db = new PgDbClient(settings);
! db.Connect();
! }
! catch (PgClientException ex)
! {
! throw new PgException(ex.Message, ex);
! }
! }
!
! public void Disconnect()
! {
! try
! {
! db.Disconnect();
! }
! catch (PgClientException ex)
! {
! throw new PgException(ex.Message, ex);
! }
! }
!
! private void parseConnectionString()
! {
! MatchCollection elements = search.Matches(connectionString);
!
! foreach (Match element in elements)
! {
! if (element.Groups[2].Value.Trim().Length > 0)
! {
! switch (element.Groups[1].Value.Trim().ToLower())
! {
! case "datasource":
! case "server":
! case "host":
! settings.ServerName = element.Groups[2].Value.Trim();
! break;
!
! case "database":
! settings.Database = element.Groups[2].Value.Trim();
! break;
!
! case "user name":
! case "user":
! settings.UserName = element.Groups[2].Value.Trim();
! break;
!
! case "user password":
! case "password":
! settings.UserPassword = element.Groups[2].Value.Trim();
! break;
!
! case "port":
! settings.ServerPort = Int32.Parse(element.Groups[2].Value.Trim());
! break;
!
! case "connection lifetime":
! lifetime = Int32.Parse(element.Groups[2].Value.Trim());
! break;
!
! case "timeout":
! case "connection timeout":
! settings.Timeout = Int32.Parse(element.Groups[2].Value.Trim());
! break;
!
! case "packet size":
! settings.PacketSize = Int32.Parse(element.Groups[2].Value.Trim());
! break;
!
! case "pooling":
! settings.Pooling = Boolean.Parse(element.Groups[2].Value.Trim());
! break;
!
! case "ssl":
! settings.SSL = Boolean.Parse(element.Groups[2].Value.Trim());
! break;
! }
! }
! }
!
! if (settings.UserName == String.Empty || settings.ServerName == String.Empty || settings.ServerPort == 0)
! {
! throw new ArgumentException("An invalid connection string argument has been supplied or a required connection string argument has not been supplied.");
! }
! else
! {
! if (settings.PacketSize < 512 || settings.PacketSize > 32767)
! {
! StringBuilder msg = new StringBuilder();
!
! msg.AppendFormat("'Packet Size' value of {0} is not valid.\r\nThe value should be an integer >= 512 and <= 32767.", settings.PacketSize);
!
! throw new ArgumentException(msg.ToString());
! }
! }
! }
!
! internal bool VerifyConnection()
! {
! bool isValid = true;
!
! try
! {
! // Try to send a Sync message to the PostgreSQL Server
! this.db.Sync();
! }
! catch (Exception)
! {
! isValid = false;
! }
!
! return isValid;
! }
!
! #endregion
! }
}
--- 1,219 ----
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
! using System.Text;
! using System.Collections;
! using System.Text.RegularExpressions;
!
! using PostgreSql.Data.NPgClient;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! internal sealed class PgDbConnection : MarshalByRefObject
! {
! #region Fields
!
! private PgDbClient db;
! private string connectionString;
! private PgConnectionParams settings;
! private long created;
! private long lifetime;
! private bool pooled;
! private Regex search;
!
! #endregion
!
! #region Properties
!
! public PgDbClient DB
! {
! get { return db; }
! }
!
! public string ConnectionString
! {
! get { return connectionString; }
! }
!
! public long Lifetime
! {
! get { return lifetime; }
! }
! public long Created
! {
! get { return created; }
! set { created = value; }
! }
!
! public bool Pooled
! {
! get { return pooled; }
! set { pooled = value; }
! }
!
! public PgConnectionParams Settings
! {
! get { return settings; }
! }
!
! #endregion
!
! #region Constructors
!
! private PgDbConnection()
! {
! settings = new PgConnectionParams();
! search = new Regex(@"([\w\s\d]*)\s*=\s*([^;]*)");
!
! connectionString = String.Empty;
! lifetime = 0;
! created = 0;
! pooled = true;
! }
!
! public PgDbConnection(string connectionString) : this()
! {
! this.connectionString = connectionString;
! parseConnectionString();
! }
!
! #endregion
!
! #region Methods
!
! public void Connect()
! {
! try
! {
! db = new PgDbClient(settings);
! db.Connect();
! }
! catch (PgClientException ex)
! {
! throw new PgException(ex.Message, ex);
! }
! }
!
! public void Disconnect()
! {
! try
! {
! db.Disconnect();
! }
! catch (PgClientException ex)
! {
! throw new PgException(ex.Message, ex);
! }
! }
!
! private void parseConnectionString()
! {
! MatchCollection elements = search.Matches(connectionString);
!
! foreach (Match element in elements)
! {
! if (element.Groups[2].Value.Trim().Length > 0)
! {
! switch (element.Groups[1].Value.Trim().ToLower())
! {
! case "datasource":
! case "server":
! case "host":
! settings.ServerName = element.Groups[2].Value.Trim();
! break;
!
! case "database":
! settings.Database = element.Groups[2].Value.Trim();
! break;
!
! case "user name":
! case "user":
! settings.UserName = element.Groups[2].Value.Trim();
! break;
!
! case "user password":
! case "password":
! settings.UserPassword = element.Groups[2].Value.Trim();
! break;
!
! case "port":
! settings.ServerPort = Int32.Parse(element.Groups[2].Value.Trim());
! break;
!
! case "connection lifetime":
! lifetime = Int32.Parse(element.Groups[2].Value.Trim());
! break;
!
! case "timeout":
! case "connection timeout":
! settings.Timeout = Int32.Parse(element.Groups[2].Value.Trim());
! break;
!
! case "packet size":
! settings.PacketSize = Int32.Parse(element.Groups[2].Value.Trim());
! break;
!
! case "pooling":
! settings.Pooling = Boolean.Parse(element.Groups[2].Value.Trim());
! break;
!
! case "ssl":
! settings.SSL = Boolean.Parse(element.Groups[2].Value.Trim());
! break;
! }
! }
! }
!
! if (settings.UserName == String.Empty || settings.ServerName == String.Empty || settings.ServerPort == 0)
! {
! throw new ArgumentException("An invalid connection string argument has been supplied or a required connection string argument has not been supplied.");
! }
! else
! {
! if (settings.PacketSize < 512 || settings.PacketSize > 32767)
! {
! StringBuilder msg = new StringBuilder();
!
! msg.AppendFormat("'Packet Size' value of {0} is not valid.\r\nThe value should be an integer >= 512 and <= 32767.", settings.PacketSize);
!
! throw new ArgumentException(msg.ToString());
! }
! }
! }
!
! internal bool VerifyConnection()
! {
! bool isValid = true;
!
! try
! {
! // Try to send a Sync message to the PostgreSQL Server
! this.db.Sync();
! }
! catch (Exception)
! {
! isValid = false;
! }
!
! return isValid;
! }
!
! #endregion
! }
}
Index: PgError.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgError.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PgError.cs 2 Aug 2003 19:43:01 -0000 1.1.1.1
--- PgError.cs 14 Dec 2003 15:06:50 -0000 1.2
***************
*** 1,125 ****
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! [Serializable]
! public sealed class PgError
! {
! #region FIELDS
!
! private string severity;
! private string code;
! private string message;
! private string detail;
! private string hint;
! private string where;
! private string position;
! private string file;
! private int line;
! private string routine;
!
! #endregion
!
! #region PROPERTIES
!
! public string Severity
! {
! get { return severity; }
! set { severity = value; }
! }
!
! public string Message
! {
! get { return message; }
! set { message = value; }
! }
!
! public string Code
! {
! get { return code; }
! set { code = value; }
! }
!
! public string Detail
! {
! get { return detail; }
! set { detail = value; }
! }
!
! public string Hint
! {
! get { return hint; }
! set { hint = value; }
! }
!
! public string Where
! {
! get { return where; }
! set { where = value; }
! }
!
! public string Position
! {
! get { return position; }
! set { position = value; }
! }
!
! public string File
! {
! get { return file; }
! set { file = value; }
! }
!
! public int Line
! {
! get { return line; }
! set { line = value; }
! }
!
! public string Routine
! {
! get { return routine; }
! set { routine = value; }
! }
!
! #endregion
!
! #region CONSTRUCTORS
!
! internal PgError()
! {
! }
!
! internal PgError(string message)
! {
! this.message = message;
! }
!
! internal PgError(string severity, string code, string message)
! {
! this.severity = severity;
! this.code = code;
! this.message = message;
! }
!
! #endregion
! }
! }
--- 1,125 ----
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! [Serializable]
! public sealed class PgError
! {
! #region Fields
!
! private string severity;
! private string code;
! private string message;
! private string detail;
! private string hint;
! private string where;
! private string position;
! private string file;
! private int line;
! private string routine;
!
! #endregion
!
! #region Properties
!
! public string Severity
! {
! get { return severity; }
! set { severity = value; }
! }
!
! public string Message
! {
! get { return message; }
! set { message = value; }
! }
!
! public string Code
! {
! get { return code; }
! set { code = value; }
! }
!
! public string Detail
! {
! get { return detail; }
! set { detail = value; }
! }
!
! public string Hint
! {
! get { return hint; }
! set { hint = value; }
! }
!
! public string Where
! {
! get { return where; }
! set { where = value; }
! }
!
! public string Position
! {
! get { return position; }
! set { position = value; }
! }
!
! public string File
! {
! get { return file; }
! set { file = value; }
! }
!
! public int Line
! {
! get { return line; }
! set { line = value; }
! }
!
! public string Routine
! {
! get { return routine; }
! set { routine = value; }
! }
!
! #endregion
!
! #region Constructors
!
! internal PgError()
! {
! }
!
! internal PgError(string message)
! {
! this.message = message;
! }
!
! internal PgError(string severity, string code, string message)
! {
! this.severity = severity;
! this.code = code;
! this.message = message;
! }
!
! #endregion
! }
! }
Index: PgErrorCollection.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgErrorCollection.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PgErrorCollection.cs 22 Aug 2003 15:13:50 -0000 1.2
--- PgErrorCollection.cs 14 Dec 2003 15:06:50 -0000 1.3
***************
*** 1,116 ****
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
! using System.Collections;
! using System.ComponentModel;
! using System.Globalization;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! [Serializable,
! ListBindable(false)]
! public sealed class PgErrorCollection : ICollection, IEnumerable
! {
! #region FIELDS
!
! private ArrayList errors;
!
! #endregion
!
! #region PROPERTIES
!
! public PgError this[string errorMessage]
! {
! get { return (PgError)errors[errors.IndexOf(errorMessage)]; }
! set { errors[errors.IndexOf(errorMessage)] = (PgError)value; }
! }
!
! public PgError this[int errorIndex]
! {
! get { return (PgError)errors[errorIndex]; }
! set { errors[errorIndex] = (PgError)value; }
! }
!
! public int Count
! {
! get { return errors.Count; }
! }
!
! public bool IsSynchronized
! {
! get { return errors.IsSynchronized; }
! }
!
! public object SyncRoot
! {
! get { return errors.SyncRoot; }
! }
!
! #endregion
!
! #region constructors
!
! internal PgErrorCollection()
! {
! errors = new ArrayList();
! }
!
! #endregion
!
! #region METHODS
!
! public IEnumerator GetEnumerator()
! {
! return errors.GetEnumerator();
! }
!
! public void CopyTo(Array array, int index)
! {
! errors.CopyTo(array, index);
! }
!
! internal PgError Add(PgError error)
! {
! errors.Add(error);
!
! return error;
! }
!
! internal PgError Add(string severity, string message, string code)
! {
! PgError error = new PgError(severity, code, message);
!
! return Add(error);
! }
!
! 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;
! }
! }
!
! #endregion
! }
! }
--- 1,116 ----
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
! using System.Collections;
! using System.ComponentModel;
! using System.Globalization;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! [Serializable,
! ListBindable(false)]
! public sealed class PgErrorCollection : ICollection, IEnumerable
! {
! #region Fields
!
! private ArrayList errors;
!
! #endregion
!
! #region Properties
!
! public PgError this[string errorMessage]
! {
! get { return (PgError)errors[errors.IndexOf(errorMessage)]; }
! set { errors[errors.IndexOf(errorMessage)] = (PgError)value; }
! }
!
! public PgError this[int errorIndex]
! {
! get { return (PgError)errors[errorIndex]; }
! set { errors[errorIndex] = (PgError)value; }
! }
!
! public int Count
! {
! get { return errors.Count; }
! }
!
! public bool IsSynchronized
! {
! get { return errors.IsSynchronized; }
! }
!
! public object SyncRoot
! {
! get { return errors.SyncRoot; }
! }
!
! #endregion
!
! #region constructors
!
! internal PgErrorCollection()
! {
! errors = new ArrayList();
! }
!
! #endregion
!
! #region Methods
!
! public IEnumerator GetEnumerator()
! {
! return errors.GetEnumerator();
! }
!
! public void CopyTo(Array array, int index)
! {
! errors.CopyTo(array, index);
! }
!
! internal PgError Add(PgError error)
! {
! errors.Add(error);
!
! return error;
! }
!
! internal PgError Add(string severity, string message, string code)
! {
! PgError error = new PgError(severity, code, message);
!
! return Add(error);
! }
!
! 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;
! }
! }
!
! #endregion
! }
! }
Index: PgException.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgException.cs,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PgException.cs 2 Aug 2003 19:43:01 -0000 1.1.1.1
--- PgException.cs 14 Dec 2003 15:06:50 -0000 1.2
***************
*** 1,97 ****
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
! using System.Text;
! using System.ComponentModel;
! using System.Runtime.Serialization;
! using PostgreSql.Data.NPgClient;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! [Serializable]
! public class PgException : Exception
! {
! #region FIELDS
!
! private PgErrorCollection errors;
!
! #endregion
!
! #region PROPERTIES
!
! [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
! public PgErrorCollection Errors
! {
! get { return errors; }
! }
!
! #endregion
!
! #region CONSTRUCTORS
!
! internal PgException() : base()
! {
! errors = new PgErrorCollection();
! }
!
! internal PgException(string message) : base(message)
! {
! errors = new PgErrorCollection();
! }
!
! internal PgException(SerializationInfo info, StreamingContext context) : base(info, context)
! {
! errors = new PgErrorCollection();
! }
!
! internal PgException(string message, PgClientException ex) : base(message, ex)
! {
! errors = new PgErrorCollection();
! Source = ex.Source;
!
! getPgExceptionErrors(ex);
! }
!
! #endregion
!
! #region METHODS
!
! private void getPgExceptionErrors(PgClientException ex)
! {
! foreach (PgClientError error in ex.Errors)
! {
! PgError newError = new PgError();
!
! newError.Severity = error.Severity;
! newError.Code = error.Code;
! newError.Message = error.Message;
! newError.Detail = error.Detail;
! newError.Hint = error.Hint;
! newError.Line = error.Line;
! newError.Where = error.Where;
! newError.Position = error.Position;
! newError.Routine = error.Routine;
!
! errors.Add(newError);
! }
! }
!
! #endregion
! }
}
--- 1,97 ----
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
! using System.Text;
! using System.ComponentModel;
! using System.Runtime.Serialization;
! using PostgreSql.Data.NPgClient;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! [Serializable]
! public class PgException : Exception
! {
! #region Fields
!
! private PgErrorCollection errors;
!
! #endregion
!
! #region Properties
!
! [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
! public PgErrorCollection Errors
! {
! get { return errors; }
! }
!
! #endregion
!
! #region Constructors
!
! internal PgException() : base()
! {
! errors = new PgErrorCollection();
! }
!
! internal PgException(string message) : base(message)
! {
! errors = new PgErrorCollection();
! }
!
! internal PgException(SerializationInfo info, StreamingContext context) : base(info, context)
! {
! errors = new PgErrorCollection();
! }
!
! internal PgException(string message, PgClientException ex) : base(message, ex)
! {
! errors = new PgErrorCollection();
! Source = ex.Source;
!
! getPgExceptionErrors(ex);
! }
!
! #endregion
!
! #region Methods
!
! private void getPgExceptionErrors(PgClientException ex)
! {
! foreach (PgClientError error in ex.Errors)
! {
! PgError newError = new PgError();
!
! newError.Severity = error.Severity;
! newError.Code = error.Code;
! newError.Message = error.Message;
! newError.Detail = error.Detail;
! newError.Hint = error.Hint;
! newError.Line = error.Line;
! newError.Where = error.Where;
! newError.Position = error.Position;
! newError.Routine = error.Routine;
!
! errors.Add(newError);
! }
! }
!
! #endregion
! }
}
Index: PgParameter.cs
===================================================================
RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/PostgreSql.Data.PgSqlClient/source/PgParameter.cs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** PgParameter.cs 26 Oct 2003 11:32:00 -0000 1.8
--- PgParameter.cs 14 Dec 2003 15:06:50 -0000 1.9
***************
*** 1,430 ****
! /* PgSqlClient - ADO.NET Data Provider for PostgreSQL 7.4+
! * Copyright (C) 2003 Carlos Guzmán Álvarez
! *
! * This library is free software; you can redistribute it and/or
! * modify it under the terms of the GNU Lesser General Public
! * License as published by the Free Software Foundation; either
! * version 2.1 of the License, or (at your option) any later version.
! *
! * This library is distributed in the hope that it will be useful,
! * but WITHOUT ANY WARRANTY; without even the implied warranty of
! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
! * Lesser General Public License for more details.
! *
! * You should have received a copy of the GNU Lesser General Public
! * License along with this library; if not, write to the Free Software
! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
! */
!
! using System;
! using System.Data;
! using System.ComponentModel;
!
! namespace PostgreSql.Data.PgSqlClient
! {
! [ParenthesizePropertyName(true),
! TypeConverter(typeof(Design.PgParameterConverter))]
! public sealed class PgParameter : MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable
! {
! #region FIELDS
!
! ParameterDirection direction;
! DataRowVersion sourceVersion;
! bool isNullable;
! string parameterName;
! string sourceColumn;
! object value;
! byte precision;
! byte scale;
! int...
[truncated message content] |