Adding this control as part of my DRC rewrite in C#
Index: Trunk/SharpMap/Data/Providers/DbaseReader.cs
===================================================================
--- Trunk/SharpMap/Data/Providers/DbaseReader.cs (revision 61030)
+++ Trunk/SharpMap/Data/Providers/DbaseReader.cs (working copy)
@@ -417,7 +417,16 @@
{
baseTable = new FeatureDataTable();
foreach (DbaseField dbf in DbaseColumns)
- baseTable.Columns.Add(dbf.ColumnName, dbf.DataType);
+ {
+ try
+ {
+ baseTable.Columns.Add(dbf.ColumnName, dbf.DataType);
+ }
+ catch(DuplicateNameException)
+ {
+ baseTable.Columns.Add(string.Format("{0}_1",dbf.ColumnName), dbf.DataType);
+ }
+ }
}
internal FeatureDataTable NewTable
===================================================================
--- Trunk/SharpMap/Data/Providers/DbaseReader.cs (revision 61030)
+++ Trunk/SharpMap/Data/Providers/DbaseReader.cs (working copy)
@@ -417,7 +417,16 @@
{
baseTable = new FeatureDataTable();
foreach (DbaseField dbf in DbaseColumns)
- baseTable.Columns.Add(dbf.ColumnName, dbf.DataType);
+ {
+ try
+ {
+ baseTable.Columns.Add(dbf.ColumnName, dbf.DataType);
+ }
+ catch(DuplicateNameException)
+ {
+ baseTable.Columns.Add(string.Format("{0}_1",dbf.ColumnName), dbf.DataType);
+ }
+ }
}
internal FeatureDataTable NewTable
No comments:
Post a Comment