Author: anagappan
Date: 2007-05-04 00:07:41 -0400 (Fri, 04 May 2007)
New Revision: 76655

Modified:
   trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
   trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
   trunk/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs
   trunk/mcs/class/System.Data/System.Data.SqlClient/SqlErrorCollection.cs
   trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
   trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.cs
Log:
2007-04-03  Amit Biswas  <[EMAIL PROTECTED]>

        * SqlDataReader.cs (GetSqlBytes, GetProviderSpecificFieldType)
        (GetProviderSpecificValue, GetProviderSpecificValues): Implemented
        missing API.

        * SqlParameter.cs (XmlSchemaCollectionDatabase): Implemented missing 
property
        (XmlSchemaCollectionName): Implemented missing property
        (XmlSchemaCollectionOwningSchema): Implemented missing property
        (SourceColumnNullMapping): Existing implementation was not correct, 
Replaced the implementation
        (.ctor): Implemented mising constructor new in .net 2.0

        * SqlErrorCollection.cs (CopyTo): Implemented missing API

        * SqlParameter.cs (InferSqlType): Corrected bug related to default 
values of
        SqlDbType and DbType
        (ResetSqlDbType): Implemented missing API
        (ResetDbType): Implemented missing API  

2007-03-09  Amit Biswas  <[EMAIL PROTECTED]>

        * SqlParameterCollection.cs (CopyTo): Implemented missing API



Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog 2007-05-03 
22:42:48 UTC (rev 76654)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/ChangeLog 2007-05-04 
04:07:41 UTC (rev 76655)
@@ -1,3 +1,26 @@
+2007-04-03  Amit Biswas  <[EMAIL PROTECTED]>
+
+       * SqlDataReader.cs (GetSqlBytes, GetProviderSpecificFieldType)
+       (GetProviderSpecificValue, GetProviderSpecificValues): Implemented
+       missing API.
+
+       * SqlParameter.cs (XmlSchemaCollectionDatabase): Implemented missing 
property
+       (XmlSchemaCollectionName): Implemented missing property
+       (XmlSchemaCollectionOwningSchema): Implemented missing property
+       (SourceColumnNullMapping): Existing implementation was not correct, 
Replaced the implementation
+       (.ctor): Implemented mising constructor new in .net 2.0
+
+       * SqlErrorCollection.cs (CopyTo): Implemented missing API
+
+       * SqlParameter.cs (InferSqlType): Corrected bug related to default 
values of
+       SqlDbType and DbType
+       (ResetSqlDbType): Implemented missing API
+       (ResetDbType): Implemented missing API  
+
+2007-03-09  Amit Biswas  <[EMAIL PROTECTED]>
+
+       * SqlParameterCollection.cs (CopyTo): Implemented missing API
+
 2007-04-02  Nagappan A  <[EMAIL PROTECTED]>
 
        * SqlParameter.cs: Variable name fix.

Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs  
2007-05-03 22:42:48 UTC (rev 76654)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlConnection.cs  
2007-05-04 04:07:41 UTC (rev 76655)
@@ -77,7 +77,7 @@
 
                // Connection parameters
                
-               internal TdsConnectionParameters parms = new 
TdsConnectionParameters ();
+               TdsConnectionParameters parms = new TdsConnectionParameters ();
                NameValueCollection connStringParameters = null;
                bool connectionReset;
                bool pooling;
@@ -1565,12 +1565,10 @@
                                throw new ArgumentNullException ();
                        if (newPassword.Length > 128)
                                throw new ArgumentException ("The value of 
newPassword exceeds its permittable length which is 128");
-                       SqlConnection conn = new SqlConnection 
(connectionString);
-                       using (conn) {
+                       using (SqlConnection conn = new SqlConnection 
(connectionString)) {
                                conn.Open ();
                                conn.tds.Execute (String.Format ("sp_password 
'{0}', '{1}', '{2}'",
                                                                 
conn.parms.Password, newPassword, conn.parms.User));
-                               conn.Close ();
                        }
                }
 #endif // NET_2_0

Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs  
2007-05-03 22:42:48 UTC (rev 76654)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlDataReader.cs  
2007-05-04 04:07:41 UTC (rev 76655)
@@ -1171,24 +1171,31 @@
                }
                
 #if NET_2_0
-                [MonoTODO]
-                public override Type GetProviderSpecificFieldType (int 
position)
-                {
-                        throw new NotImplementedException ();
-                }
 
-                [MonoTODO]                
-                public override object GetProviderSpecificValue (int position)
-                {
-                        throw new NotImplementedException ();                  
      
-                }
+               public override Type GetProviderSpecificFieldType (int position)
+               {
+                       return (GetSqlValue (position).GetType());
+               }
+
+               public override object GetProviderSpecificValue (int position)
+               {
+                       return (GetSqlValue (position));                        
+               }
                 
-                [MonoTODO]
-                public override int GetProviderSpecificValues (object [] 
values)
-                {
-                        throw new NotImplementedException ();                  
      
-                }
+               public override int GetProviderSpecificValues (object [] values)
+               {
+                       return (GetSqlValues (values));                        
+               }
 
+               public virtual SqlBytes GetSqlBytes (int i)
+               {
+                       //object value = GetSqlValue (i);
+                       //if (!(value is SqlBinary))
+                       //      throw new InvalidCastException ("Type is " + 
value.GetType ().ToString ());
+                       Byte[] val = (byte[])GetValue(i);
+                       SqlBytes sb = new SqlBytes (val);                       
+                       return (sb);
+               }
 #endif // NET_2_0
 
                #endregion // Methods

Modified: 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlErrorCollection.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlErrorCollection.cs     
2007-05-03 22:42:48 UTC (rev 76654)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlErrorCollection.cs     
2007-05-04 04:07:41 UTC (rev 76655)
@@ -105,6 +105,14 @@
                        return list.GetEnumerator ();
                }
 
+#if NET_2_0
+               public void CopyTo (SqlError[] array, int index)
+               {
+                       list.CopyTo (array, index);
+               }
+
+#endif // NET_2_0
+
                #endregion              
        }
 }

Modified: trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs   
2007-05-03 22:42:48 UTC (rev 76654)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameter.cs   
2007-05-04 04:07:41 UTC (rev 76655)
@@ -7,6 +7,7 @@
 //   Tim Coleman ([EMAIL PROTECTED])
 //   Diego Caravana ([EMAIL PROTECTED])
 //   Umadevi S ([EMAIL PROTECTED])
+//   Amit Biswas ([EMAIL PROTECTED])
 //
 // (C) Ximian, Inc. 2002
 // Copyright (C) Tim Coleman, 2002
@@ -70,6 +71,12 @@
                int localeId;
                Object sqlValue;
                string udtTypeName;
+#if NET_2_0
+               bool sourceColumnNullMapping;
+               string xmlSchemaCollectionDatabase = String.Empty;
+               string xmlSchemaCollectionOwningSchema = String.Empty;
+               string xmlSchemaCollectionName = String.Empty;
+#endif
 
                #endregion // Fields
 
@@ -116,6 +123,17 @@
                        SourceVersion = sourceVersion;
                }
 
+#if NET_2_0
+               public SqlParameter (string parameterName, SqlDbType dbType, 
int size, ParameterDirection direction, byte precision, byte scale, string 
sourceColumn, DataRowVersion sourceVersion, bool sourceColumnNullMapping, 
Object value, string xmlSchemaCollectionDatabase, string 
xmlSchemaCollectionOwningSchema, string xmlSchemaCollectionName)
+                       : this (parameterName, dbType, size, direction, false, 
precision, scale, sourceColumn, sourceVersion, value)
+               {
+                       XmlSchemaCollectionDatabase = 
xmlSchemaCollectionDatabase;
+                       XmlSchemaCollectionOwningSchema = 
xmlSchemaCollectionOwningSchema;
+                       XmlSchemaCollectionName = xmlSchemaCollectionName;
+                       SourceColumnNullMapping = sourceColumnNullMapping;
+               }
+#endif
+
                // This constructor is used internally to construct a
                // SqlParameter.  The value array comes from 
sp_procedure_params_rowset.
                // This is in SqlCommand.DeriveParameters.
@@ -400,11 +418,29 @@
                }
        
                public override bool SourceColumnNullMapping {
-                       get { return false ; }
-                       set { }
+                       get { return sourceColumnNullMapping; }
+                       set { sourceColumnNullMapping = value; }
                }
+
+               public string XmlSchemaCollectionDatabase {
+                       get { return xmlSchemaCollectionDatabase; } 
+                       set { xmlSchemaCollectionDatabase = (value == null ? 
String.Empty : value); }
+               }
+
+               public string XmlSchemaCollectionName {
+                       get { return xmlSchemaCollectionName; } 
+                       set {
+                               xmlSchemaCollectionName = (value == null ? 
String.Empty : value);
+                       }
+               }
+
+               public string XmlSchemaCollectionOwningSchema {
+                       get { return xmlSchemaCollectionOwningSchema; } 
+                       set {
+                               xmlSchemaCollectionOwningSchema = (value == 
null ? String.Empty : value);
+                       }
+               }
 #endif
-
                #endregion // Properties
 
                #region Methods
@@ -418,8 +454,10 @@
                // infer type information.
                private void InferSqlType (object value)
                {
-                       if (value == null || value == DBNull.Value)
+                       if (value == null || value == DBNull.Value) {
+                               SetSqlDbType (SqlDbType.NVarChar);
                                return;
+                       }
 
                        Type type = value.GetType ();
 
@@ -820,11 +858,16 @@
                }
 
 #if NET_2_0
-               [MonoTODO ("Not implemented")]
+               
                 public override void ResetDbType ()
                 {
-                        throw new NotImplementedException ();
+                        InferSqlType (metaParameter.Value);
                 }
+
+               public void ResetSqlDbType ()
+               {
+                       InferSqlType (metaParameter.Value);
+               }
 #endif // NET_2_0
 
                #endregion // Methods

Modified: 
trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.cs 
2007-05-03 22:42:48 UTC (rev 76654)
+++ trunk/mcs/class/System.Data/System.Data.SqlClient/SqlParameterCollection.cs 
2007-05-04 04:07:41 UTC (rev 76655)
@@ -440,6 +440,11 @@
                
                        this.AddRange(values);  
                }
+               
+               public void CopyTo (SqlParameter[] array, int index)
+               {
+                       list.CopyTo (array, index);
+               }
 #endif
         
                #endregion // Methods   

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

Reply via email to