---
title: "Can I assign values from my collection in a string array..?? (c#)"  
description: "Can I assign values from my collection in a string array..?? (c#)"  
author: "Jayden Bell"  
published: 2013-05-03  
updated: 2013-05-03  
canonical: https://www.mindstick.com/forum/798/can-i-assign-values-from-my-collection-in-a-string-array-c-sharp  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# Can I assign values from my collection in a string array..?? (c#)

Hi Everyone!\
I [am trying](https://answers.mindstick.com/qa/36834/which-two-programming-languages-should-i-master-in-if-i-am-trying-to-get-into-google-or-facebook) to get [values](https://www.mindstick.com/forum/327/sum-textbox-values) from name value [collection](https://www.mindstick.com/articles/1718/collections-in-java) and trying to [store](https://www.mindstick.com/articles/13125/tips-to-increase-sales-of-your-woocommerce-store) it in a [string array](https://www.mindstick.com/forum/12803/check-for-any-item-in-string-array)\
for (int i=0; i<arr.Length; i++){ arr[i] = DataRowColl.GetValue[i];}DataRow.Coll is my namevaluecollection. Its [giving](https://yourviews.mindstick.com/view/80639/regifting-is-far-better-than-giving-away-a-bouquet) the error that [reference](https://www.mindstick.com/forum/774/reference-what-does-this-error-mean-in-php) without parentheses, Can I assign values from my collection in a string array..??\
Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)! \

## Replies

### Reply by AVADHESH PATEL

Hi Jayden!\
GetValue is not a member of NameValueCollection. The function is called Get. If you want to use the [] operator, you don't have do call the Get function. So call\
arr[i] = DataRowColl[i];or:\
arr[i] = DataRowColl.Get(i);


---

Original Source: https://www.mindstick.com/forum/798/can-i-assign-values-from-my-collection-in-a-string-array-c-sharp

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
