Sfoglia il codice sorgente

2005-04-04 Sureshkumar T <[email protected]>

	* OdbcDataReader.cs: Ignore BaseTableName & BaseColumnName
	properties while building Schema information as most drivers
	ignores these properties. e.g. PostgreSQL.


svn path=/trunk/mcs/; revision=42505
Sureshkumar T 21 anni fa
parent
commit
867af6a6c1

+ 6 - 0
mcs/class/System.Data/System.Data.Odbc/ChangeLog

@@ -1,3 +1,9 @@
+2005-04-04  Sureshkumar T  <[email protected]>
+
+	* OdbcDataReader.cs: Ignore BaseTableName & BaseColumnName
+	properties while building Schema information as most drivers
+	ignores these properties. e.g. PostgreSQL.
+
 2005-03-24  Sureshkumar T  <[email protected]>
 	    Appasamy <[email protected]>
 

+ 14 - 4
mcs/class/System.Data/System.Data.Odbc/OdbcDataReader.cs

@@ -567,10 +567,20 @@ namespace System.Data.Odbc
                                                 }
                                         }
 
-					schemaRow["BaseCatalogName"] = "";				
-					schemaRow["BaseColumnName"] = GetColumnAttributeStr (i+1, FieldIdentifier.BaseColumnName);
-					schemaRow["BaseSchemaName"] = "";
-					schemaRow["BaseTableName"] = GetColumnAttributeStr (i+1, FieldIdentifier.BaseTableName);
+                                        schemaRow["BaseCatalogName"] = "";
+                                        schemaRow["BaseColumnName"] = "";
+                                        schemaRow["BaseSchemaName"] = "";
+                                        schemaRow["BaseTableName"] = "";
+
+                                        try {
+                                                schemaRow["BaseColumnName"] = GetColumnAttributeStr (i+1, FieldIdentifier.BaseColumnName);
+                                                schemaRow["BaseTableName"] = GetColumnAttributeStr (i+1, FieldIdentifier.BaseTableName);
+                                        } catch (Exception e) {
+                                                // ignore these properties as they are optional.
+                                        }
+                                        
+
+
 					schemaRow["DataType"] = col.DataType;
 
 					schemaRow["AllowDBNull"] = col.AllowDBNull;