private void ImportFieldsFromDbf() { OpenFileDialog dlg = new OpenFileDialog { Filter = SymbologyFormsMessageStrings. TableEditorControl_ImportFieldsFromDbf_DBase_Files____dbf____DBF }; FeatureSet fsTemp = new FeatureSet(); fsTemp.CopyFeatures(_featureLayer.DataSet, true); if (dlg.ShowDialog() != DialogResult.OK) { MessageBox.Show(SymbologyFormsMessageStrings.TableEditorControl_ImportFieldsFromDbf_Could_not_import_column_fields); return; } string shapeFilePath2 = dlg.FileName; int count = shapeFilePath2.Length; shapeFilePath2 = shapeFilePath2.Remove(count - 4, 4); //remove the extension of the file shapeFilePath2 = shapeFilePath2 + ".shp"; //add IFeatureSet fs = FeatureSet.Open(shapeFilePath2); int noOfCol = fs.DataTable.Columns.Count; //Add all column header for (int i = 0; i < noOfCol; i++) { DataColumn dtcol = new DataColumn(fs.DataTable.Columns[i].ColumnName, fs.DataTable.Columns[i].DataType); if (fsTemp.DataTable.Columns.Contains(fs.DataTable.Columns[i].ColumnName) == false) fsTemp.DataTable.Columns.Add(dtcol); } dataGridView1.DataSource = fsTemp.DataTable; }