Author: uma
Date: 2005-05-24 23:33:30 -0400 (Tue, 24 May 2005)
New Revision: 44964

Added:
   
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlClientMetaDataCollectionNames.cs
Modified:
   trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
   trunk/mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopyColumnMapping.cs
   trunk/mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopyOptions.cs
   trunk/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs
   
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlNotificationTransports.cs
   trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
   trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.cs
Log:
fixed some 2.0 and 1.0 specific fields/attributes for various classes.
        * Added SqlClientMetaDataCollectionNames.cs, Implemented some 2.0
        properties for SqlParameterCollection for the bulkcopy feature.
                                                                                
                    


Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog 2005-05-25 
03:31:43 UTC (rev 44963)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog 2005-05-25 
03:33:30 UTC (rev 44964)
@@ -1,3 +1,9 @@
+2005-05-24 Umadevi S <[EMAIL PROTECTED]>
+       * fixed some 2.0 and 1.0 specific fields/attributes for various classes.
+       * Added SqlClientMetaDataCollectionNames.cs, Implemented some 2.0
+       properties for SqlParameterCollection for the bulkcopy feature.
+       
+
 2005-05-20 Kornél Pál <http://www.kornelpal.hu/>
        
        * Fixed Bug #53169 - SqlDataReader incorrectly returns bigint as decimal

Modified: 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopyColumnMapping.cs
===================================================================
--- 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopyColumnMapping.cs   
    2005-05-25 03:31:43 UTC (rev 44963)
+++ 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopyColumnMapping.cs   
    2005-05-25 03:33:30 UTC (rev 44964)
@@ -92,7 +92,7 @@
                }
        }
        
-       public String SoruceColumn {
+       public String SourceColumn {
                 get {
                         if (this.sourceColumn != null)
                                 return sourceColumn;

Modified: 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopyOptions.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopyOptions.cs     
2005-05-25 03:31:43 UTC (rev 44963)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlBulkCopyOptions.cs     
2005-05-25 03:33:30 UTC (rev 44964)
@@ -45,7 +45,7 @@
                KeepIdentity = 1,
                KeepNulls = 8,
                TableLock = 4,
-               UseInternalTranscation = 32
+               UseInternalTransaction = 32
        }
 
 }

Added: 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlClientMetaDataCollectionNames.cs
===================================================================
--- 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlClientMetaDataCollectionNames.cs
       2005-05-25 03:31:43 UTC (rev 44963)
+++ 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlClientMetaDataCollectionNames.cs
       2005-05-25 03:33:30 UTC (rev 44964)
@@ -0,0 +1,62 @@
+//
+// System.Data.SqlClient.SqlClientMetaDataCollectionNames.cs
+//
+// Author:
+//   Umadevi S <[EMAIL PROTECTED]>
+//
+
+//
+// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+namespace System.Data.SqlClient
+{
+       /// <summary>
+       /// Collection names
+       /// </summary>
+       //note : MS documentation has it as public sealed abstract.!
+       public sealed class SqlClientMetaDataCollectionNames {
+
+       public static readonly string Columns;
+       public static readonly string Databases;
+       public static readonly string ForeignKeys;
+       public static readonly string IndexColumns;
+       public static readonly string Indexes;
+       public static readonly string Parameters;
+       public static readonly string ProcedureColumns;
+       public static readonly string Procedures;
+       public static readonly string Tables;
+       public static readonly string UserDefinedTypes;
+       public static readonly string Users;
+       public static readonly string ViewColumns;
+       public static readonly string Views;
+               
+       
+       }
+
+}
+
+
+#endif
+

Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs   
2005-05-25 03:31:43 UTC (rev 44963)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs   
2005-05-25 03:33:30 UTC (rev 44964)
@@ -37,12 +37,19 @@
 using System;
 using System.ComponentModel;
 using System.Data;
+using System.Data.Common;
 using System.Runtime.Serialization;
 using System.Text;
 
 namespace System.Data.SqlClient {
-       [Serializable]
-       public sealed class SqlException : SystemException
+       [SerializableAttribute()]
+
+       public sealed class SqlException
+#if NET_2_0
+        : DbException
+#else
+        : SystemException
+#endif //NET_1_1
        {
                #region Fields
 

Modified: 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlNotificationTransports.cs
===================================================================
--- 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlNotificationTransports.cs  
    2005-05-25 03:31:43 UTC (rev 44963)
+++ 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlNotificationTransports.cs  
    2005-05-25 03:33:30 UTC (rev 44964)
@@ -35,6 +35,8 @@
        /// <summary>
        /// Describes the differnt transports that can be used between the 
client and the server.
        /// </summary>
+       [Flags]
+       [Serializable]
        public enum SqlNotificationTransports {
 
                Any = -1,

Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs   
2005-05-25 03:31:43 UTC (rev 44963)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs   
2005-05-25 03:33:30 UTC (rev 44964)
@@ -165,7 +165,7 @@
                        set { container = value; }
                }
 
-#if NET_1_1    
+#if ONLY_1_0 || ONLY_1_1       
                [Browsable (false)]
                [DataSysDescription ("The parameter generic type.")]
                [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
@@ -185,7 +185,7 @@
                }
 
                [DataCategory ("Data")]
-#if NET_1_1
+#if ONLY_1_0 || ONLY_1_1
                [DataSysDescription ("Input, output, or bidirectional 
parameter.")]
                [DefaultValue (ParameterDirection.Input)]
 #endif
@@ -223,7 +223,7 @@
                        set { metaParameter.ParameterName = value; }
                }
 
-#if NET_1_1
+#if ONLY_1_0 || ONLY_1_1
                [Browsable (false)]
                [DataSysDescription ("a design-time property used for strongly 
typed code-generation.")]
                [DefaultValue (false)]
@@ -241,7 +241,7 @@
 
                [Browsable (false)]
                [DataCategory ("Data")]
-#if NET_1_1
+#if ONLY_1_0 || ONLY_1_1
                [DataSysDescription ("Offset in variable length data types.")]
                [DefaultValue (0)]
 #endif
@@ -257,7 +257,7 @@
                        set { offset = value; }
                }
        
-#if NET_1_1    
+#if ONLY_1_0 || ONLY_1_1       
                [DataSysDescription ("Name of the parameter, like '@p1'")]
                [DefaultValue ("")]
 #endif
@@ -271,7 +271,7 @@
                }
 
                [DataCategory ("Data")]
-#if NET_1_1
+#if ONLY_1_0 || ONLY_1_1
                [DataSysDescription ("For decimal, numeric, varnumeric 
DBTypes.")]
                [DefaultValue (0)]
 #endif
@@ -289,7 +289,7 @@
                }
 
                [DataCategory ("Data")]
-#if NET_1_1
+#if ONLY_1_0 || ONLY_1_1
                [DataSysDescription ("For decimal, numeric, varnumeric 
DBTypes.")]
                [DefaultValue (0)]
 #endif
@@ -307,7 +307,7 @@
                }
 
                [DataCategory ("Data")]
-#if NET_1_1
+#if ONLY_1_0 || ONLY_1_1
                [DataSysDescription ("Size of variable length data types 
(strings & arrays).")]
                [DefaultValue (0)]
 #endif
@@ -321,7 +321,7 @@
                }
 
                [DataCategory ("Data")]
-#if NET_1_1
+#if ONLY_1_0 || ONLY_1_1
                [DataSysDescription ("When used by a DataAdapter.Update, the 
source column name that is used to find the DataSetColumn name in the 
ColumnMappings. This is to copy a value between the parameter and a datarow.")]
                [DefaultValue ("")]
 #endif
@@ -335,7 +335,7 @@
                }
 
                [DataCategory ("Data")]
-#if NET_1_1
+#if ONLY_1_0 || ONLY_1_1
                [DataSysDescription ("When used by a DataAdapter.Update 
(UpdateCommand only), the version of the DataRow value that is used to update 
the data source.")]
                [DefaultValue (DataRowVersion.Current)]
 #endif
@@ -349,7 +349,7 @@
                }
                
                [DataCategory ("Data")]
-#if NET_1_1
+#if ONLY_1_0 || ONLY_1_1
                [DataSysDescription ("The parameter native type.")]
                [DefaultValue (SqlDbType.NVarChar)]
 #endif
@@ -366,7 +366,7 @@
                }
 
                [DataCategory ("Data")]
-#if NET_1_1
+#if ONLY_1_0 || ONLY_1_1
                [DataSysDescription ("Value of the parameter.")]
                [DefaultValue (null)]
 #endif
@@ -387,10 +387,10 @@
                        }
                }
 
-#if NET_2_0
+//#if NET_2_0
 //             public SqlCompareOptions CompareInfo{
 
-#endif
+//#endif
 
                #endregion // Properties
 

Modified: 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.cs 
2005-05-25 03:31:43 UTC (rev 44963)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.cs 
2005-05-25 03:33:30 UTC (rev 44964)
@@ -6,6 +6,7 @@
 //   Daniel Morgan ([EMAIL PROTECTED])
 //   Tim Coleman ([EMAIL PROTECTED])
 //   Diego Caravana ([EMAIL PROTECTED])
+//   Umadevi S ([EMAIL PROTECTED])
 //
 // (C) Ximian, Inc 2002
 // Copyright (C) Tim Coleman, 2002
@@ -74,9 +75,12 @@
                #endregion // Constructors
 
                #region Properties
-
+#if ONLY_1_1 || ONLY_1_0
                [Browsable (false)]
                [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]      
+#endif
+
+
                public 
 #if NET_2_0
                override
@@ -85,6 +89,34 @@
                        get { return list.Count; }                        
                }
 
+#if NET_2_0
+               public override bool IsFixedSize {
+                       get {
+                               return list.IsFixedSize;
+                       }       
+               }
+
+               public override bool IsReadOnly {
+                       get {
+                               return list.IsReadOnly;
+                       }
+               }
+
+               public override bool IsSynchronized {
+                       get {
+                               return list.IsSynchronized;
+                       }
+               }
+
+               public override object SyncRoot {
+                       get {
+                               return list.SyncRoot;
+                       }
+               }
+       
+
+#endif
+
                [Browsable (false)]
                [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]      
                public 
@@ -125,6 +157,32 @@
                        }                         
                }
 
+#if NET_2_0
+               protected  DbParameter GetParameter (int index)
+               {
+                       throw new NotImplementedException();
+               }
+
+                protected  void SetParameter (int index, DbParameter value)
+               {
+                        throw new NotImplementedException();
+                }
+               /*public IEnumerator GetEnumerator ()
+                        {
+                        throw new NotImplementedException();
+                }*/
+
+
+               protected override Type ItemType 
+               { 
+                       get {
+                               throw new NotImplementedException();
+                       }
+
+                }                                                          
+
+                                                                               
                     
+#endif
                object IList.this [int index] {
                        get { return (SqlParameter) this [index]; }
                        set { this [index] = (SqlParameter) value; }
@@ -146,6 +204,8 @@
                        get { return list.SyncRoot; }
                }
 
+
+
                internal TdsMetaParameterCollection MetaParameters {
                        get { return metaParameters; }
                }
@@ -233,7 +293,16 @@
                                        return true;
                        return false;
                }
+#if NET_2_0
 
+               public bool Contains (SqlParameter value) {
+       
+                       return (this.IndexOf(value) != -1);
+               }       
+
+#endif // NET_2_0
+
+
                public 
 #if NET_2_0
                override
@@ -276,6 +345,13 @@
 
                }
 
+#if NET_2_0
+               public int IndexOf (SqlParameter value) {
+                               return list.IndexOf(value);
+               }
+               
+#endif // NET_2_0
+
                public 
 #if NET_2_0
                override
@@ -285,18 +361,41 @@
                        list.Insert (index, value);
                }
 
+#if NET_2_0
+               public void Insert (int index, SqlParameter value) {
+                       list.Insert (index,value);
+               }
+
+#endif //NET_2_0       
+
                public 
 #if NET_2_0
                override
 #endif // NET_2_0
         void Remove (object value)
                {
+                       //TODO : this neds validation to check if the object is 
a 
+                       // sqlparameter.
+                                       
                        ((SqlParameter) value).Container = null;
                        
                        metaParameters.Remove (((SqlParameter) 
value).MetaParameter);
                        list.Remove (value);
                }
 
+
+#if NET_2_0
+               public void Remove (SqlParameter value) {
+       
+                       //both this and the above code are the same. but need 
to work with
+                       // 1.1!
+                       value.Container = null;
+                       metaParameters.Remove (value.MetaParameter);
+                       list.Remove (value);
+
+               }
+
+#endif //NET_2_0 
                public 
 #if NET_2_0
                override
@@ -317,18 +416,31 @@
                        RemoveAt (IndexOf (parameterName));
                }
 
-                [MonoTODO]
-                protected 
 #if NET_2_0
-               override
-#endif // NET_2_0
-        Type ItemType
-                {
-                        get {throw new NotImplementedException ();}
-                        
-                }
+               public override void AddRange (Array values) {
+               
+                       if (values == null)
+                               throw new ArgumentNullException("The argument 
passed was null");
+                       foreach ( object value in values) {
+                          if (!(value is SqlParameter))
+                                       throw new InvalidCastException 
("Element in the array parameter was not an SqlParameter.");                    
                                                 
+                          SqlParameter param = (SqlParameter) value;   
+                          if (param.Container != null)
+                                throw new ArgumentException ("An SqlParameter 
specified in the array is already added to this or another 
SqlParameterCollection.");
+                                                                               
                     
+                        param.Container = this;
+                        list.Add (param);
+                        metaParameters.Add (param.MetaParameter);
+                        }
+       
+               }               
 
-
+               public void AddRange (SqlParameter[] values) {
+               
+                       this.AddRange(values);  
+               }
+#endif
+        
                #endregion // Methods   
        }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to