Author: suresh
Date: 2005-03-24 10:26:48 -0500 (Thu, 24 Mar 2005)
New Revision: 42220

Modified:
   trunk/mcs/class/System.Data/System.Data.Odbc/ChangeLog
   trunk/mcs/class/System.Data/System.Data.Odbc/OdbcColumn.cs
   trunk/mcs/class/System.Data/System.Data.Odbc/OdbcDataReader.cs
Log:
2005-03-24  Sureshkumar T  <[EMAIL PROTECTED]>
            Appasamy <[EMAIL PROTECTED]>

        * OdbcColumn.cs: IsStringType: OdbcType.Char is also of type
        String.
        * OdbcDataReader.cs: GetSchemaTable: Get Additional info using
        SQLColAttribute. Don't pad with spaces in GetColAttributeStr.



Modified: trunk/mcs/class/System.Data/System.Data.Odbc/ChangeLog
===================================================================
--- trunk/mcs/class/System.Data/System.Data.Odbc/ChangeLog      2005-03-24 
15:11:54 UTC (rev 42219)
+++ trunk/mcs/class/System.Data/System.Data.Odbc/ChangeLog      2005-03-24 
15:26:48 UTC (rev 42220)
@@ -1,5 +1,13 @@
 2005-03-24  Sureshkumar T  <[EMAIL PROTECTED]>
+           Appasamy <[EMAIL PROTECTED]>
 
+       * OdbcColumn.cs: IsStringType: OdbcType.Char is also of type
+       String.
+       * OdbcDataReader.cs: GetSchemaTable: Get Additional info using
+       SQLColAttribute. Don't pad with spaces in GetColAttributeStr.
+
+2005-03-24  Sureshkumar T  <[EMAIL PROTECTED]>
+
        * OdbcDataReader.cs:
        - GetValue: Decode only outsize length for SQL_C_TYPE.CHAR type in
        SQLGetData.

Modified: trunk/mcs/class/System.Data/System.Data.Odbc/OdbcColumn.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.Odbc/OdbcColumn.cs  2005-03-24 
15:11:54 UTC (rev 42219)
+++ trunk/mcs/class/System.Data/System.Data.Odbc/OdbcColumn.cs  2005-03-24 
15:26:48 UTC (rev 42220)
@@ -133,6 +133,7 @@
                        {
                                switch (OdbcType)
                                {
+                                       case OdbcType.Char:
                                        case OdbcType.Text:
                                        case OdbcType.NText:
                                        case OdbcType.NVarChar:

Modified: trunk/mcs/class/System.Data/System.Data.Odbc/OdbcDataReader.cs
===================================================================
--- trunk/mcs/class/System.Data/System.Data.Odbc/OdbcDataReader.cs      
2005-03-24 15:11:54 UTC (rev 42219)
+++ trunk/mcs/class/System.Data/System.Data.Odbc/OdbcDataReader.cs      
2005-03-24 15:26:48 UTC (rev 42220)
@@ -498,7 +498,13 @@
                 override
 #endif // NET_2_0
                 DataTable GetSchemaTable() 
-               {       
+               {
+                        // FIXME : 
+                        // * Map OdbcType to System.Type and assign to 
DataType.
+                        //   This will eliminate the need for IsStringType in
+                        //   OdbcColumn.
+                        // * Cache this DataTable so that it is not contacting 
+                        //   datasource everytime for the same result set.
 
                        DataTable dataTableSchema = null;
                        // Only Results from SQL SELECT Queries 
@@ -545,12 +551,11 @@
                                        dataTableSchema.Rows.Add (schemaRow);
                                                                                
                                        schemaRow["ColumnName"] = 
col.ColumnName;
-                                       schemaRow["ColumnOrdinal"] = i + 1;
+                                       schemaRow["ColumnOrdinal"] = i;
                                        
                                        schemaRow["ColumnSize"] = col.MaxLength;
-                                       schemaRow["NumericPrecision"] = 0;
-                                       schemaRow["NumericScale"] = 0;
-                                       // TODO: need to get KeyInfo
+                                       schemaRow["NumericPrecision"] = 
GetColumnAttribute (i+1, FieldIdentifier.Precision);
+                                       schemaRow["NumericScale"] = 
GetColumnAttribute (i+1, FieldIdentifier.Scale);
 
                                        schemaRow["IsUnique"] = false;
                                        schemaRow["IsKey"] = DBNull.Value;
@@ -563,9 +568,9 @@
                                         }
 
                                        schemaRow["BaseCatalogName"] = "";      
                        
-                                       schemaRow["BaseColumnName"] = 
col.ColumnName;
+                                       schemaRow["BaseColumnName"] = 
GetColumnAttributeStr (i+1, FieldIdentifier.BaseColumnName);
                                        schemaRow["BaseSchemaName"] = "";
-                                       schemaRow["BaseTableName"] = "";
+                                       schemaRow["BaseTableName"] = 
GetColumnAttributeStr (i+1, FieldIdentifier.BaseTableName);
                                        schemaRow["DataType"] = col.DataType;
 
                                        schemaRow["AllowDBNull"] = 
col.AllowDBNull;
@@ -575,7 +580,7 @@
                                        schemaRow["IsAliased"] = false;
                                        schemaRow["IsExpression"] = false;
                                        schemaRow["IsIdentity"] = false;
-                                       schemaRow["IsAutoIncrement"] = false;
+                                       schemaRow["IsAutoIncrement"] = 
GetColumnAttribute (i+1, FieldIdentifier.AutoUniqueValue) == 1;
                                        schemaRow["IsRowVersion"] = false;
                                        schemaRow["IsHidden"] = false;
                                        schemaRow["IsLong"] = false;
@@ -862,7 +867,9 @@
                                                                         
OdbcHandleType.Stmt,
                                                                         hstmt)
                                                          );
-                        string value = Encoding.Default.GetString (buffer);
+                        string value = "";
+                        if (outsize > 0)
+                                value = Encoding.Default.GetString (buffer, 0, 
outsize);
                         return value;
                 }
 

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

Reply via email to