# DbfColumn and FeatureSourceColumn properties

**URL:** <https://community.thinkgeo.com/t/dbfcolumn-and-featuresourcecolumn-properties/1760>\
**Category:** WinForms\
**Created:** [July 21, 2011, 3:09pm UTC](https://community.thinkgeo.com/t/dbfcolumn-and-featuresourcecolumn-properties/1760 "2011-07-21T15:09:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/b/50afbb/32.png) [@Brian1](https://community.thinkgeo.com/u/Brian1)\
**Post date:** [July 21, 2011, 3:09pm UTC](https://community.thinkgeo.com/t/dbfcolumn-and-featuresourcecolumn-properties/1760/1 "2011-07-21T15:09:22Z")

</div>

Why&nbsp;on&nbsp;a&nbsp;DbfColumn&nbsp;when&nbsp;its&nbsp;casted&nbsp;to&nbsp;a&nbsp;FeatureSourceColumn&nbsp;the&nbsp;ColumnName,&nbsp;MaxLength&nbsp;and&nbsp;TypeName&nbsp;properties&nbsp;not&nbsp;populated?&nbsp;&nbsp;I&nbsp;assumed&nbsp;they&nbsp;would&nbsp;report&nbsp;the&nbsp;DbfColumn&nbsp;ColumnName,&nbsp;Length&nbsp;and&nbsp;ColumnType.ToString()&nbsp;properties

I&nbsp;use&nbsp;the&nbsp;DbfColumn&nbsp;when&nbsp;converting&nbsp;from&nbsp;our&nbsp;own&nbsp;layer&nbsp;column&nbsp;format&nbsp;(from&nbsp;a&nbsp;custom&nbsp;system)&nbsp;because&nbsp;it&nbsp;allows&nbsp;me&nbsp;to&nbsp;preserve&nbsp;the&nbsp;type,&nbsp;length&nbsp;and&nbsp;decimal&nbsp;places&nbsp;of&nbsp;a&nbsp;column&nbsp;much&nbsp;better.&nbsp;&nbsp;(our&nbsp;system&nbsp;was&nbsp;based&nbsp;on&nbsp;shape&nbsp;file&nbsp;sources)&nbsp;&nbsp;But&nbsp;this&nbsp;appears&nbsp;to&nbsp;cause&nbsp;problems&nbsp;when&nbsp;trying&nbsp;to&nbsp;render&nbsp;our&nbsp;custom&nbsp;FeatureLayer&nbsp;that&nbsp;has&nbsp;DbfColumns&nbsp;for&nbsp;its&nbsp;columns.

I&nbsp;can&nbsp;probably&nbsp;convert&nbsp;back&nbsp;to&nbsp;FeatureSourceColumns&nbsp;and&nbsp;retain&nbsp;all&nbsp;the&nbsp;data&nbsp;I&nbsp;need,&nbsp;but&nbsp;seems&nbsp;like&nbsp;something&nbsp;may&nbsp;not&nbsp;be&nbsp;correct&nbsp;in&nbsp;the&nbsp;DbfColumn&nbsp;object.

Thanks

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [July 22, 2011, 10:44am UTC](https://community.thinkgeo.com/t/dbfcolumn-and-featuresourcecolumn-properties/1760/2 "2011-07-22T10:44:46Z")

</div>

&nbsp;Brian,

They&nbsp;have&nbsp;different&nbsp;field&nbsp;members,&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;convert&nbsp;DbfColumn&nbsp;to&nbsp;FeatureSourceColumn,&nbsp;you&nbsp;can&nbsp;use&nbsp;following&nbsp;code:

FeatureSourceColumn&nbsp;featurSourceColumn&nbsp;=&nbsp;new&nbsp;FeatureSourceColumn(dbfColumn.ColumnName,&nbsp;dbfColumn.ColumnType.ToString(),&nbsp;dbfColumn.Length);

&nbsp;Thanks,

&nbsp;James

---

<div class="post-metadata">

**Author:** ![Brian1](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/b/50afbb/32.png) [@Brian1](https://community.thinkgeo.com/u/Brian1)\
**Post date:** [July 22, 2011, 10:53am UTC](https://community.thinkgeo.com/t/dbfcolumn-and-featuresourcecolumn-properties/1760/3 "2011-07-22T10:53:10Z")

</div>

So&nbsp;DbfColumn&nbsp;inherits&nbsp;from&nbsp;FeatureSourceColumn,&nbsp;but&nbsp;can't&nbsp;be&nbsp;used&nbsp;as&nbsp;a&nbsp;FeatureSourceColumn.

I&nbsp;can&nbsp;work&nbsp;around&nbsp;that&nbsp;by&nbsp;inheriting&nbsp;from&nbsp;FeatureSourceColumn&nbsp;to&nbsp;hold&nbsp;the&nbsp;extra&nbsp;column&nbsp;definition&nbsp;data&nbsp;I&nbsp;need,&nbsp;but&nbsp;seems&nbsp;like&nbsp;that&nbsp;is&nbsp;a&nbsp;poor&nbsp;design&nbsp;choice.

Thanks

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [July 25, 2011, 10:37am UTC](https://community.thinkgeo.com/t/dbfcolumn-and-featuresourcecolumn-properties/1760/4 "2011-07-25T10:37:48Z")

</div>

Brian,&nbsp;  
&nbsp;&nbsp;  
&nbsp;I&nbsp;think&nbsp;your&nbsp;idea&nbsp;is&nbsp;right,&nbsp;this&nbsp;design&nbsp;is&nbsp;not&nbsp;good,&nbsp;but&nbsp;we&nbsp;couldn’t&nbsp;change&nbsp;it&nbsp;in&nbsp;following&nbsp;version,&nbsp;because&nbsp;it&nbsp;will&nbsp;cause&nbsp;breaking-change&nbsp;problem,&nbsp;we&nbsp;will&nbsp;consider&nbsp;to&nbsp;make&nbsp;it&nbsp;obsolete&nbsp;and&nbsp;add&nbsp;some&nbsp;better&nbsp;API&nbsp;to&nbsp;fit&nbsp;this&nbsp;requirement.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks,&nbsp;  
&nbsp;James&nbsp;
