C#.NET Script – Associative Array

Associative array is very useful due to its flexibility and expandability. It can contain any data types and unlimited sub arrays. So far, .NET framework has not provide similar functionality with PHP associative array. Don’t worry, we can still do it in C#.NET by utilizing dictionary. We have to use dictionary to keep the order of array element entry. If we use hashtable, the element order will be messed up. In this article, we will show you how dictionary can support the flexibility and expandability of PHP associative array.

Source Code

Get the script/source code here

Incoming Search Terms

c# associative array, net associative array, associative array c#, associative array in c sharp, c# associative arrays, associative array in c#, c sharp associative array, associative array in net, csharp associative array, associative array c sharp, associative array NET, net associative arrays, c# named array, c# associated array, Associative Arrays in C#, associative array csharp, c associative array, associative arrays c#, c# Script array, c net associative array, c# net associative array, net named array, csharp assoc array, net associative array guid, named array C#, c# array associativi, c# named arrays, c# assoc array, c# associate array, c# key value array, c# foreach associative array, csharp associative arrays, c# associative array hashtable, csharp foreach associative array, c# associative arraylist, associative arrays c sharp, associative arraylist, associate array in C#, associated array in c#, net collections generic dictionary<object object>, associative arrays in c sharp, csharp named array, csharp php arrays named, print associative array c#, csharp associative list, csharp associative arrayx, raport z array list c#, return a javascript associative array from CSharp, csharp for each associative array, namedarray C#, creating associative array in c#, cast associative array to hashtable c#, vettori associativo c#, convert javascript associative array to c# dictionary, using associative array in c sharp, use of associative array in c#, script sharp net, convert json to c# class dictionaries (associative arrays), script sharp assosiative arrays javascript, convert php associative array to net, plugins for dictionary in c, foreach associative array in c#, foreach c# associative array, knockoutjs associative array, net hashed array, named array in csharp, named arrays in c#, named indexed array c#, net flexible array, net c associative array, net Array string key, net associate array, indexed array c# net, how to use associative array in c sharp, net static associative array, how to associate 2 arrays in c#, net screept c#, how to create an associative array in c#, net new associative array, public class associativearray, net named array<, how to make associative array in c#, net managed object to javascript associative array, net class associated arrays, array associativo c#, associative array net 4, associative array of T c#, associative array php c#, associative arraylist c#, associative arrays c# 2 0, associative arrays c# foreach, array associate in c#, associative in C#, associative lists c#, associativeArray C#, assosiated array in C#, Associative array list c#, associative array in c, assoc array c#, assoc array in c#, Xhanch, Xhanch Studio

Posted on 2010-02-15 by Susanto BSc in C#.NET Script, Free Script
Dictionary, Flexible, C#.NET, Associative Array, .net, Element, Code, Expandable, Free, Array, C#, Script, Associative, Hashtable, Xhanch, Xhanch Studio

Tagged as: , , , , , , , , , , , , ,

2 Responses to “C#.NET Script – Associative Array”

  1. aleroot says:

    This method in the class :
    public static bool IsAssociativeArray(){
    return (this.Item.GetType().ToString().StartsWith(“System.Collections.Generic.Dictionary”));

    Give me an error “Impossible use Keyword this in static method” !

    When i try to do this in my program :

    mp.Item = arr.Item[key];

    Give me an error :
    Cast Missing , Impossible convert object in ‘System.Collections.Generic.Dictionary’.

    Why ?
    Have you try to use this class ??

    • Susanto BSc says:

      This class has been tested for sure since I have used it on some of my projects.
      The error you get does not make sense.
      FYI, this class is built under .NET FX 3.5.
      Perhaps it is caused by incompatible version.

Leave a Reply

You must be logged in to post a comment.