يوجد العديد من الصفوف التي تمكننا من التعامل مع البيانات، هذه الصفوف موجودة في فضاء الأسماء System.Collections منها: ArrayList، SortedList، Queue، Stack، Hashtable، BitArray، StringCollection، StringDictionary، ListDictionary، HybridDictionary، NameValueCollection.
إضافة وحذف عناصر:
الصف ArrayList: تسمح لنا بتخزين أي كائنات نشاء حيث يقبل الاجراء Add كائن (Object) الكود التالي يوضح كيفية إضافة عناصر إليها:
using System.Collections;
ArrayList coll = new ArrayList();
// Add individual items to the collection
string s = “Hello”;
coll.Add(s);
coll.Add(“hi”);
coll.Add(50);
coll.Add(new object());