# Adding feature to FeatureLayer

**URL:** <https://community.thinkgeo.com/t/adding-feature-to-featurelayer/1941>\
**Category:** WinForms\
**Created:** [April 2, 2012, 5:10am UTC](https://community.thinkgeo.com/t/adding-feature-to-featurelayer/1941 "2012-04-02T05:10:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hotter](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@Hotter](https://community.thinkgeo.com/u/Hotter)\
**Post date:** [April 2, 2012, 5:10am UTC](https://community.thinkgeo.com/t/adding-feature-to-featurelayer/1941/1 "2012-04-02T05:10:40Z")

</div>

Hi,

How&nbsp;do&nbsp;I&nbsp;add&nbsp;feature&nbsp;to&nbsp;FeatureLayer&nbsp;from&nbsp;another&nbsp;FeatureLayer&nbsp;with&nbsp;all&nbsp;column&nbsp;values?  
  
I&nbsp;try&nbsp;like&nbsp;this:

`//Works, but seems that doesn't add column valuesmyLayer.FeatureSource.AddFeature(feature);//Doesn't work like this at all (invalid arguments). What should be the second variable?myLayer.FeatureSource.AddFeature(feature, feature.ColumnValues);`

---

<div class="post-metadata">

**Author:** ![Hotter](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@Hotter](https://community.thinkgeo.com/u/Hotter)\
**Post date:** [April 2, 2012, 6:03am UTC](https://community.thinkgeo.com/t/adding-feature-to-featurelayer/1941/2 "2012-04-02T06:03:08Z")

</div>

I&nbsp;find&nbsp;out&nbsp;that&nbsp;I&nbsp;needed&nbsp;to&nbsp;add&nbsp;all&nbsp;columns&nbsp;manually&nbsp;like&nbsp;this:

&nbsp;

`myLayer.Open();oldLayer.Open();Collection<FeatureSourceColumn> fsc = oldLayer.QueryTools.GetColumns();foreach(FeatureSourceColumn fsctmp in fsc)	myLayer.Columns.Add(fsctmp);oldLayer.Close();myLayer.Close();`

---

<div class="post-metadata">

**Author:** ![Val](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/e56c9b/32.png) [@Val](https://community.thinkgeo.com/u/Val)\
**Post date:** [April 2, 2012, 11:43am UTC](https://community.thinkgeo.com/t/adding-feature-to-featurelayer/1941/3 "2012-04-02T11:43:32Z")

</div>

Hotter,

&nbsp;You&nbsp;are&nbsp;not&nbsp;giving&nbsp;us&nbsp;the&nbsp;context&nbsp;in&nbsp;which&nbsp;you&nbsp;are&nbsp;performing&nbsp;adding&nbsp;features&nbsp;to&nbsp;a&nbsp;FeatureLayer&nbsp;from&nbsp;another&nbsp;FeatureLayer,&nbsp;but&nbsp;it&nbsp;seems&nbsp;to&nbsp;me&nbsp;that&nbsp;you&nbsp;are&nbsp;doing&nbsp;something&nbsp;similar&nbsp;to&nbsp;Intersecting&nbsp;two&nbsp;layers.&nbsp;We&nbsp;have&nbsp;a&nbsp;sample&nbsp;in&nbsp;the&nbsp;Code&nbsp;Community&nbsp;_Intersecting&nbsp;Two&nbsp;Layers&nbsp;_[wiki.thinkgeo.com/wiki/Map\_Suite\_De...Two\_Layers](http://wiki.thinkgeo.com/wiki/Map_Suite_Desktop_Edition_Spatial_Functions_Samples#Intersecting_Two_Layers)&nbsp;where&nbsp;we&nbsp;create&nbsp;a&nbsp;new&nbsp;FeatureLayer&nbsp;from&nbsp;the&nbsp;result&nbsp;of&nbsp;the&nbsp;intersection&nbsp;of&nbsp;two&nbsp;original&nbsp;FeatureLayers&nbsp;combining&nbsp;the&nbsp;columns&nbsp;of&nbsp;both&nbsp;original&nbsp;FeatureLayers&nbsp;to&nbsp;the&nbsp;new&nbsp;one.&nbsp;I&nbsp;think&nbsp;you&nbsp;are&nbsp;doing&nbsp;soemthing&nbsp;pretty&nbsp;similar.&nbsp;If&nbsp;not,&nbsp;give&nbsp;us&nbsp;a&nbsp;little&nbsp;more&nbsp;background&nbsp;on&nbsp;your&nbsp;case.&nbsp;Thank&nbsp;you.
