Thread: [pgsqlclient-checkins] pgsqlclient_10/source/PostgreSql/Data/PostgreSqlClient PgCommand.cs,1.1,1.2 P
Status: Inactive
Brought to you by:
carlosga_fb
From: Carlos G. Á. <car...@us...> - 2005-09-09 21:35:09
|
Update of /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/PostgreSqlClient In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5092/Data/PostgreSqlClient Modified Files: PgCommand.cs PgCommandBuilder.cs PgConnection.cs PgConnectionInternal.cs PgDataAdapter.cs PgDataReader.cs PgErrorCollection.cs PgException.cs PgParameter.cs PgParameterCollection.cs PgTransaction.cs Log Message: Started the reorganization of the CVS module Index: PgConnectionInternal.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/PostgreSqlClient/PgConnectionInternal.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgConnectionInternal.cs 8 Sep 2005 18:41:54 -0000 1.1 --- PgConnectionInternal.cs 9 Sep 2005 21:35:00 -0000 1.2 *************** *** 22,28 **** using System.Text; using System.Text.RegularExpressions; - - using Mono.Security.Protocol.Tls; - using PostgreSql.Data.Protocol; using PostgreSql.Data.DbSchema; --- 22,25 ---- *************** *** 124,129 **** this.pooled = true; this.database = new PgDbClient(); ! this.owningConnection = owningConnection; ! if (connectionString != null) { --- 121,125 ---- this.pooled = true; this.database = new PgDbClient(); ! if (connectionString != null) { *************** *** 140,145 **** try { - this.database.SslConnection = new SslConnectionCallback(OnSslConnection); - this.database.Settings = this.Options; this.database.Connect(); --- 136,139 ---- *************** *** 347,363 **** #endregion - - #region SSL Callbacks - - private void OnSslConnection() - { - // Server certificate validation - this.database.SslClientStream.ServerCertValidationDelegate = new CertificateValidationCallback(owningConnection.OnServerCertificateValidation); - - // Client certificate selection - this.database.SslClientStream.ClientCertSelectionDelegate = new CertificateSelectionCallback(owningConnection.OnClientCertificateSelection); - } - - #endregion } } \ No newline at end of file --- 341,344 ---- Index: PgDataReader.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/PostgreSqlClient/PgDataReader.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgDataReader.cs 8 Sep 2005 18:41:54 -0000 1.1 --- PgDataReader.cs 9 Sep 2005 21:35:00 -0000 1.2 *************** *** 31,35 **** namespace PostgreSql.Data.PostgreSqlClient { ! public sealed class PgDataReader : MarshalByRefObject, IEnumerable, IDataReader, IDisposable, IDataRecord { #region · Fields · --- 31,35 ---- namespace PostgreSql.Data.PostgreSqlClient { ! public sealed class PgDataReader : DbDataReader { #region · Fields · *************** *** 49,52 **** --- 49,66 ---- #endregion + #region · Indexers · + + public override object this[int i] + { + get { return this.GetValue(i); } + } + + public override object this[string name] + { + get { return this.GetValue(this.GetOrdinal(name)); } + } + + #endregion + #region · Constructors · *************** *** 71,74 **** --- 85,89 ---- #region · Finalizer · + /// <include file='Doc/en_EN/FbDataReader.xml' path='doc/class[@name="FbDataReader"]/destructor[@name="Finalize"]/*'/> ~PgDataReader() { *************** *** 78,84 **** #endregion ! #region · IDisposable Methods · ! void IDisposable.Dispose() { this.Dispose(true); --- 93,99 ---- #endregion ! #region · IDisposable methods · ! public override void Dispose() { this.Dispose(true); *************** *** 96,104 **** // release any managed resources this.Close(); - - this.command = null; - this.connection = null; - this.row = null; - this.schemaTable= null; } --- 111,114 ---- *************** *** 108,112 **** { } ! this.disposed = true; } --- 118,122 ---- { } ! this.disposed = true; } *************** *** 115,141 **** #endregion ! #region IDataReader Properties & Methods ! public int Depth { get { return 0; } } ! public bool IsClosed { get { return !this.open; } } ! public int RecordsAffected { get { return this.IsClosed ? this.recordsAffected : -1; } } ! public bool HasRows { get { return this.command.Statement.HasRows; } } ! public void Close() { if (!this.open) --- 125,151 ---- #endregion ! #region · IDataReader Properties & Methods · ! public override int Depth { get { return 0; } } ! public override bool IsClosed { get { return !this.open; } } ! public override int RecordsAffected { get { return this.IsClosed ? this.recordsAffected : -1; } } ! public override bool HasRows { get { return this.command.Statement.HasRows; } } ! public override void Close() { if (!this.open) *************** *** 170,179 **** } ! public bool NextResult() { return false; } ! public bool Read() { bool read = false; --- 180,189 ---- } ! public override bool NextResult() { return false; } ! public override bool Read() { bool read = false; *************** *** 207,213 **** #endregion ! #region GetSchemaTable Method ! public DataTable GetSchemaTable() { if (schemaTable == null) --- 217,223 ---- #endregion ! #region · GetSchemaTable Method · ! public override DataTable GetSchemaTable() { if (schemaTable == null) *************** *** 355,380 **** #endregion ! #region Indexers ! ! public object this[int i] ! { ! get { return this.GetValue(i); } ! } ! ! public object this[string name] ! { ! get { return this.GetValue(this.GetOrdinal(name)); } ! } ! ! #endregion ! ! #region IDataRecord Properties & Methods ! public int FieldCount { get { return this.command.Statement.RowDescriptor.Fields.Length; } } ! public String GetName(int i) { this.CheckIndex(i); --- 365,376 ---- #endregion ! #region · IDataRecord Properties & Methods · ! public override int FieldCount { get { return this.command.Statement.RowDescriptor.Fields.Length; } } ! public override String GetName(int i) { this.CheckIndex(i); *************** *** 384,388 **** [EditorBrowsable(EditorBrowsableState.Never)] ! public String GetDataTypeName(int i) { this.CheckIndex(i); --- 380,384 ---- [EditorBrowsable(EditorBrowsableState.Never)] ! public override string GetDataTypeName(int i) { this.CheckIndex(i); *************** *** 391,395 **** } ! public Type GetFieldType(int i) { this.CheckIndex(i); --- 387,391 ---- } ! public override Type GetFieldType(int i) { this.CheckIndex(i); *************** *** 398,402 **** } ! public object GetValue(int i) { this.CheckPosition(); --- 394,398 ---- } ! public override object GetValue(int i) { this.CheckPosition(); *************** *** 406,414 **** } ! public int GetValues(object[] values) { this.CheckPosition(); ! for (int i = 0; i < FieldCount; i++) { values[i] = GetValue(i); --- 402,410 ---- } ! public override int GetValues(object[] values) { this.CheckPosition(); ! for (int i = 0; i < this.FieldCount; i++) { values[i] = GetValue(i); *************** *** 418,422 **** } ! public int GetOrdinal(string name) { if (this.IsClosed) --- 414,418 ---- } ! public override int GetOrdinal(string name) { if (this.IsClosed) *************** *** 425,429 **** } ! for (int i = 0; i < this.command.Statement.RowDescriptor.Fields.Length; i++) { if (this.CultureAwareCompare(command.Statement.RowDescriptor.Fields[i].FieldName, name)) --- 421,425 ---- } ! for (int i = 0; i < this.FieldCount; i++) { if (this.CultureAwareCompare(command.Statement.RowDescriptor.Fields[i].FieldName, name)) *************** *** 436,440 **** } ! public bool GetBoolean(int i) { this.CheckPosition(); --- 432,436 ---- } ! public override bool GetBoolean(int i) { this.CheckPosition(); *************** *** 444,448 **** } ! public byte GetByte(int i) { this.CheckPosition(); --- 440,444 ---- } ! public override byte GetByte(int i) { this.CheckPosition(); *************** *** 452,461 **** } ! public long GetBytes( ! int i, ! long dataIndex, ! byte[] buffer, ! int bufferIndex, ! int length) { int bytesRead = 0; --- 448,452 ---- } ! public override long GetBytes(int i, long dataIndex, byte[] buffer, int bufferIndex, int length) { int bytesRead = 0; *************** *** 498,502 **** [EditorBrowsable(EditorBrowsableState.Never)] ! public char GetChar(int i) { this.CheckPosition(); --- 489,493 ---- [EditorBrowsable(EditorBrowsableState.Never)] ! public override char GetChar(int i) { this.CheckPosition(); *************** *** 506,515 **** } ! public long GetChars( ! int i, ! long dataIndex, ! char[] buffer, ! int bufferIndex, ! int length) { this.CheckPosition(); --- 497,501 ---- } ! public override long GetChars(int i, long dataIndex, char[] buffer, int bufferIndex, int length) { this.CheckPosition(); *************** *** 555,564 **** } ! public Guid GetGuid(int i) { throw new NotSupportedException("Guid datatype is not supported"); } ! public Int16 GetInt16(int i) { this.CheckPosition(); --- 541,550 ---- } ! public override Guid GetGuid(int i) { throw new NotSupportedException("Guid datatype is not supported"); } ! public override Int16 GetInt16(int i) { this.CheckPosition(); *************** *** 568,572 **** } ! public Int32 GetInt32(int i) { this.CheckPosition(); --- 554,558 ---- } ! public override Int32 GetInt32(int i) { this.CheckPosition(); *************** *** 576,580 **** } ! public Int64 GetInt64(int i) { this.CheckPosition(); --- 562,566 ---- } ! public override Int64 GetInt64(int i) { this.CheckPosition(); *************** *** 584,588 **** } ! public float GetFloat(int i) { this.CheckPosition(); --- 570,574 ---- } ! public override float GetFloat(int i) { this.CheckPosition(); *************** *** 592,596 **** } ! public double GetDouble(int i) { this.CheckPosition(); --- 578,582 ---- } ! public override double GetDouble(int i) { this.CheckPosition(); *************** *** 600,604 **** } ! public String GetString(int i) { this.CheckPosition(); --- 586,590 ---- } ! public override string GetString(int i) { this.CheckPosition(); *************** *** 608,612 **** } ! public Decimal GetDecimal(int i) { this.CheckPosition(); --- 594,598 ---- } ! public override Decimal GetDecimal(int i) { this.CheckPosition(); *************** *** 616,620 **** } ! public DateTime GetDateTime(int i) { this.CheckPosition(); --- 602,606 ---- } ! public override DateTime GetDateTime(int i) { this.CheckPosition(); *************** *** 708,717 **** } ! public IDataReader GetData(int i) ! { ! throw new NotSupportedException(); ! } ! ! public bool IsDBNull(int i) { this.CheckPosition(); --- 694,698 ---- } ! public override bool IsDBNull(int i) { this.CheckPosition(); *************** *** 730,736 **** #endregion ! #region IEnumerable Methods ! IEnumerator IEnumerable.GetEnumerator() { return new DbEnumerator(this); --- 711,717 ---- #endregion ! #region · IEnumerable Methods · ! public override IEnumerator GetEnumerator() { return new DbEnumerator(this); Index: PgErrorCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/PostgreSqlClient/PgErrorCollection.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgErrorCollection.cs 8 Sep 2005 18:41:54 -0000 1.1 --- PgErrorCollection.cs 9 Sep 2005 21:35:00 -0000 1.2 *************** *** 24,29 **** namespace PostgreSql.Data.PostgreSqlClient { ! [Serializable, ! ListBindable(false)] public sealed class PgErrorCollection : ICollection, IEnumerable { --- 24,28 ---- namespace PostgreSql.Data.PostgreSqlClient { ! [Serializable, ListBindable(false)] public sealed class PgErrorCollection : ICollection, IEnumerable { Index: PgParameterCollection.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/PostgreSqlClient/PgParameterCollection.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgParameterCollection.cs 8 Sep 2005 18:41:54 -0000 1.1 --- PgParameterCollection.cs 9 Sep 2005 21:35:00 -0000 1.2 *************** *** 19,22 **** --- 19,23 ---- using System; using System.Data; + using System.Data.Common; using System.ComponentModel; using System.Collections; *************** *** 25,68 **** namespace PostgreSql.Data.PostgreSqlClient { ! [ListBindable(false), ! Editor(typeof(Design.PgParameterCollectionEditor), typeof(System.Drawing.Design.UITypeEditor))] ! public sealed class PgParameterCollection : MarshalByRefObject, IDataParameterCollection, IList, ICollection, IEnumerable { #region · Fields · ! private ArrayList parameters = new ArrayList(); #endregion ! #region · Properties · ! object IDataParameterCollection.this[string parameterName] { ! get { return this[parameterName]; } ! set { this[parameterName] = (PgParameter)value; } } ! [Browsable(false), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public PgParameter this[string parameterName] { ! get { return (PgParameter)this[IndexOf(parameterName)]; } ! set { this[IndexOf(parameterName)] = (PgParameter)value; } } ! object IList.this[int parameterIndex] { ! get { return (PgParameter)this.parameters[parameterIndex]; } ! set { this.parameters[parameterIndex] = (PgParameter)value; } } ! [Browsable(false), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public PgParameter this[int parameterIndex] { ! get { return (PgParameter)this.parameters[parameterIndex]; } ! set { this.parameters[parameterIndex] = (PgParameter)value; } } ! #endregion --- 26,88 ---- namespace PostgreSql.Data.PostgreSqlClient { ! [ListBindable(false)] ! [Editor(typeof(Design.PgParameterCollectionEditor), typeof(System.Drawing.Design.UITypeEditor))] ! public sealed class PgParameterCollection : DbParameterCollection { #region · Fields · ! private ArrayList parameters; #endregion ! #region · Indexers · ! [Browsable(false)] ! [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public new PgParameter this[string parameterName] { ! get { return (PgParameter)this[this.IndexOf(parameterName)]; } ! set { this[this.IndexOf(parameterName)] = (PgParameter)value; } } ! [Browsable(false)] ! [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public new PgParameter this[int index] { ! get { return (PgParameter)this.parameters[index]; } ! set { this.parameters[index] = (PgParameter)value; } } ! #endregion ! ! #region · DbParameterCollection Properties · ! ! [Browsable(false)] ! [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public override int Count { ! get { return this.parameters.Count; } } ! public override bool IsFixedSize { ! get { return this.parameters.IsFixedSize; } } ! ! public override bool IsReadOnly ! { ! get { return this.parameters.IsReadOnly; } ! } ! ! public override bool IsSynchronized ! { ! get { return this.parameters.IsSynchronized; } ! } ! ! public override object SyncRoot ! { ! get { return this.parameters.SyncRoot; } ! } ! #endregion *************** *** 71,158 **** internal PgParameterCollection() { } #endregion ! #region · IList Properties · ! bool IList.IsFixedSize { ! get { return this.parameters.IsFixedSize; } } ! bool IList.IsReadOnly { ! get { return this.parameters.IsReadOnly; } } #endregion ! #region · ICollection Properties · ! [Browsable(false), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public int Count { ! get { return this.parameters.Count; } } ! ! bool ICollection.IsSynchronized { ! get { return this.parameters.IsSynchronized; } } ! object ICollection.SyncRoot { ! get { return this.parameters.SyncRoot; } } ! #endregion ! ! #region · ICollection Methods · ! public void CopyTo(Array array, int index) { ! this.parameters.CopyTo(array, index); } ! #endregion ! #region · IList Methods · ! public void Clear() { ! this.parameters.Clear(); } ! #endregion ! #region · IEnumerable Methods · ! public IEnumerator GetEnumerator() ! { ! return this.parameters.GetEnumerator(); } ! #endregion ! #region · Methods · ! public bool Contains(object value) { return this.parameters.Contains(value); } ! public bool Contains(string parameterName) { return (-1 != this.IndexOf(parameterName)); } ! public int IndexOf(object value) { return this.parameters.IndexOf(value); } ! public int IndexOf(string parameterName) { int index = 0; --- 91,224 ---- internal PgParameterCollection() { + this.parameters = ArrayList.Synchronized(new ArrayList()); } #endregion ! #region · DbParameterCollection Protected methods · ! protected override DbParameter GetParameter(string parameterName) { ! return this[parameterName]; } ! protected override DbParameter GetParameter(int index) { ! return this[index]; ! } ! ! protected override void SetParameter(int index, DbParameter value) ! { ! this[index] = (PgParameter)value; ! } ! ! protected override void SetParameter(string parameterName, DbParameter value) ! { ! this[parameterName] = (PgParameter)value; } #endregion ! #region · DbParameterCollection overriden methods · ! public override void CopyTo(Array array, int index) { ! this.parameters.CopyTo(array, index); } ! ! public override void Clear() { ! this.parameters.Clear(); } ! public override IEnumerator GetEnumerator() { ! return this.parameters.GetEnumerator(); } ! public override void AddRange(Array values) ! { ! foreach (PgParameter parameter in values) ! { ! this.Add(parameter); ! } ! } ! public PgParameter Add(string parameterName, object value) { ! return this.Add(new PgParameter(parameterName, value)); } ! public PgParameter Add(string parameterName, PgDbType providerType) ! { ! return this.Add(new PgParameter(parameterName, providerType)); ! } ! public PgParameter Add(string parameterName, PgDbType providerType, int size) ! { ! return this.Add(new PgParameter(parameterName, providerType, size)); ! } ! public PgParameter Add(string parameterName, PgDbType providerType, int size, string sourceColumn) { ! return this.Add(new PgParameter(parameterName, providerType, size, sourceColumn)); } ! public PgParameter Add(PgParameter value) ! { ! lock (this.parameters.SyncRoot) ! { ! if (value == null) ! { ! throw new ArgumentException("The value parameter is null."); ! } ! if (value.Parent != null) ! { ! throw new ArgumentException("The PgParameter specified in the value parameter is already added to this or another FbParameterCollection."); ! } ! if (value.ParameterName == null || value.ParameterName.Length == 0) ! { ! //value.ParameterName = this.GenerateParameterName(); ! } ! else ! { ! if (this.IndexOf(value) != -1) ! { ! throw new ArgumentException("PgParameterCollection already contains PgParameter with ParameterName '" + value.ParameterName + "'."); ! } ! } ! this.parameters.Add(value); ! return value; ! } } ! public override int Add(object value) ! { ! if (!(value is PgParameter)) ! { ! throw new InvalidCastException("The parameter passed was not a PgParameter."); ! } ! return this.IndexOf(this.Add(value as PgParameter)); ! } ! public override bool Contains(object value) { return this.parameters.Contains(value); } ! public override bool Contains(string parameterName) { return (-1 != this.IndexOf(parameterName)); } ! public override int IndexOf(object value) { return this.parameters.IndexOf(value); } ! public override int IndexOf(string parameterName) { int index = 0; *************** *** 160,168 **** foreach (PgParameter item in this.parameters) { ! if (this.CultureAwareCompare(item.ParameterName, parameterName)) { return index; } - index++; } --- 226,233 ---- foreach (PgParameter item in this.parameters) { ! if (item.ParameterName == parameterName) { return index; } index++; } *************** *** 171,180 **** } ! public void Insert(int index, object value) { this.parameters.Insert(index, value); } ! public void Remove(object value) { if (!(value is PgParameter)) --- 236,245 ---- } ! public override void Insert(int index, object value) { this.parameters.Insert(index, value); } ! public override void Remove(object value) { if (!(value is PgParameter)) *************** *** 182,186 **** throw new InvalidCastException("The parameter passed was not a PgParameter."); } - if (!this.Contains(value)) { --- 247,250 ---- *************** *** 189,269 **** this.parameters.Remove(value); - } - - public void RemoveAt(int index) - { - this.parameters.RemoveAt(index); - } ! public void RemoveAt(string parameterName) ! { ! this.RemoveAt(IndexOf(parameterName)); } ! public int Add(object value) { ! if (!(value is PgParameter)) ! { ! throw new InvalidCastException("The parameter passed was not a PgParameter."); ! } ! ! return this.parameters.Add((PgParameter)value); } ! public PgParameter Add(PgParameter param) { ! if (param.ParameterName != null) ! { ! this.parameters.Add(param); ! ! return param; ! } ! else { ! throw new ArgumentException("parameter must be named"); } - } - - public PgParameter Add(string parameterName, PgDbType PgType) - { - PgParameter param = new PgParameter(parameterName, PgType); - - return Add(param); - } - - public PgParameter Add(string parameterName, object value) - { - PgParameter param = new PgParameter(parameterName, value); ! return Add(param); ! } ! ! public PgParameter Add(string parameterName, PgDbType PgType, int size) ! { ! PgParameter param = new PgParameter(parameterName, PgType, size); ! ! return Add(param); ! } ! ! public PgParameter Add(string parameterName, PgDbType PgType, int size, string sourceColumn) ! { ! PgParameter param = new PgParameter(parameterName, PgType, size, sourceColumn); ! ! return Add(param); ! } ! ! #endregion ! ! #region · Private Methods · ! ! private bool CultureAwareCompare(string strA, string strB) ! { ! return CultureInfo.CurrentCulture.CompareInfo.Compare( ! strA, ! strB, ! CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth | ! CompareOptions.IgnoreCase) == 0 ? true : false; } ! #endregion } --- 253,276 ---- this.parameters.Remove(value); ! ((PgParameter)value).Parent = null; } ! public override void RemoveAt(string parameterName) { ! this.RemoveAt(this.IndexOf(parameterName)); } ! public override void RemoveAt(int index) { ! if (index < 0 || index > this.Count) { ! throw new IndexOutOfRangeException("The specified index does not exist."); } ! this[index].Parent = null; ! this.parameters.RemoveAt(index); } ! #endregion } Index: PgCommandBuilder.cs =================================================================== RCS file: /cvsroot/pgsqlclient/pgsqlclient_10/source/PostgreSql/Data/PostgreSqlClient/PgCommandBuilder.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PgCommandBuilder.cs 8 Sep 2005 18:41:54 -0000 1.1 --- PgCommandBuilder.cs 9 Sep 2005 21:35:00 -0000 1.2 *************** *** 27,831 **** namespace PostgreSql.Data.PostgreSqlClient { ! public sealed class PgCommandBuilder : Component ! { ! #region · Fields · ! ! private PgDataAdapter dataAdapter; ! private PgCommand insertCommand; ! private PgCommand updateCommand; ! private PgCommand deleteCommand; ! private DataTable schemaTable; ! private string sqlInsert; ! private string sqlUpdate; ! private string sqlDelete; ! private string separator; ! private string whereClausule1; ! private string whereClausule2; ! private string setClausule; ! private string tableName; ! private bool hasPrimaryKey; ! private bool hasUniqueKey; ! private string quotePrefix; ! private string quoteSuffix; ! private bool disposed; ! ! private PgRowUpdatingEventHandler adapterHandler; ! ! #endregion ! ! #region · Properties · ! ! [DefaultValue(null)] ! public PgDataAdapter DataAdapter ! { ! get { return this.dataAdapter; } ! set ! { ! this.dataAdapter = value; ! ! // Registers the CommandBuilder as a listener for RowUpdating events that are ! // generated by the PgDataAdapter specified in this property. ! if (this.dataAdapter != null) ! { ! this.adapterHandler = new PgRowUpdatingEventHandler(this.RowUpdatingHandler); ! this.dataAdapter.RowUpdating += this.adapterHandler; ! } ! } ! } ! ! [Browsable(false), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public string QuotePrefix ! { ! get { return this.quotePrefix; } ! set ! { ! if (this.insertCommand != null || ! this.updateCommand != null || ! this.deleteCommand != null) ! { ! throw new InvalidOperationException("This property cannot be changed after an insert, update, or delete command has been generated."); ! } ! ! this.quotePrefix = value; ! } ! } ! ! [Browsable(false), ! DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] ! public string QuoteSuffix ! { ! get { return this.quoteSuffix; } ! set ! { ! if (this.insertCommand != null || ! this.updateCommand != null || ! this.deleteCommand != null) ! { ! throw new InvalidOperationException("This property cannot be changed after an insert, update, or delete command has been generated."); ! } ! ! this.quoteSuffix = value; ! } ! } ! ! #endregion ! ! #region · Internal Properties · ! ! internal PgCommand SelectCommand ! { ! get ! { ! if (this.dataAdapter.SelectCommand != null) ! { ! return this.dataAdapter.SelectCommand; ! } ! ! return null; ! } ! } ! ! #endregion ! ! #region · Constructors · ! ! public PgCommandBuilder() : base() ! { ! this.sqlInsert = "INSERT INTO {0} ({1}) VALUES ({2})"; ! this.sqlUpdate = "UPDATE {0} SET {1} WHERE ( {2} )"; ! this.sqlDelete = "DELETE FROM {0} WHERE ( {1} )"; ! this.whereClausule1 = "(({0} IS NULL AND ${1} = NULL) OR ({0} = ${2}))"; ! // this.whereClausule2 = "({0} = ${1})"; ! // this.setClausule = "{0} = ${1}"; ! this.whereClausule2 = "({0} = {1})"; ! this.setClausule = "{0} = {1}"; ! this.separator = ", "; ! this.quotePrefix = String.Empty; ! this.quoteSuffix = String.Empty; ! ! GC.SuppressFinalize(this); ! } ! ! public PgCommandBuilder(PgDataAdapter adapter) : this() ! { ! this.DataAdapter = adapter; ! } ! ! #endregion ! ! #region · IDisposable Methods · ! ! protected override void Dispose(bool disposing) ! { ! if (!this.disposed) ! { ! try ! { ! if (disposing) ! { ! this.RefreshSchema(); ! ! if (this.adapterHandler != null) ! { ! this.dataAdapter.RowUpdating -= this.adapterHandler; ! } ! ! this.sqlInsert = null; ! this.sqlUpdate = null; ! this.sqlDelete = null; ! this.whereClausule1 = null; ! this.whereClausule2 = null; ! this.setClausule = null; ! this.separator = null; ! this.quotePrefix = null; ! this.quoteSuffix = null; ! } ! ! // release any unmanaged resources ! ! this.disposed = true; ! } ! finally ! { ! base.Dispose(disposing); ! } ! } ! } ! ! #endregion ! ! #region · Static Methods · ! ! public static void DeriveParameters(PgCommand command) ! { ! if (command.CommandType != CommandType.Sto... [truncated message content] |