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, associative array c#, net associative array, associative array in c sharp, c# associative arrays, associative array in c#, c sharp associative array, associative array in net, associative array c sharp, csharp associative array, associative array NET, c# named array, net associative arrays, c# associated array, Associative Arrays in C#, associative array csharp, net named array, c associative array, c# net associative array, associative arrays c#, c net associative array, c# Script array, net associative array guid, csharp assoc array, c# array associativi, c# named arrays, named array C#, c# assoc array, c# key value array, associated array in c#, c# foreach associative array, c# associate array, csharp associative arrays, csharp foreach associative array, c# associative array hashtable, c# associative arraylist, associative arraylist, associative arrays in c sharp, associate array in C#, net collections generic dictionary<object object>, associative arrays c sharp, csharp named array, raport z array list c#, public class associativearray, csharp associative arrayx, csharp associative list, plugins for dictionary in c, print associative array c#, csharp php arrays named, csharp for each associative array, return a javascript associative array from CSharp, vettori associativo c#, cast associative array to hashtable c#, using associative array in c sharp, use of associative array in c#, script sharp net, convert javascript associative array to c# dictionary, convert json to c# class dictionaries (associative arrays), script sharp assosiative arrays javascript, convert php associative array to net, creating associative array in c#, net static associative array, foreach associative array in c#, foreach c# associative array, net hashed array, named array in csharp, net flexible array, named arrays in c#, named indexed array c#, namedarray C#, net c associative array, net Array string key, net associate array, knockoutjs associative array, indexed array c# net, net screept c#, how to associate 2 arrays in c#, net new associative array, how to create an associative array in c#, net named array<, net managed object to javascript associative array, how to make associative array in c#, net class associated arrays, how to use associative array in c sharp, net associated array, C# как уничтожить переменную#, 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, Xhanch, Xhanch Studio

Posted on 2010-02-15 by Susanto BSc in C#.NET Script, Free Script
C#.NET, Associative, Dictionary, Free, Element, Associative Array, Flexible, Script, .net, Array, C#, Code, Expandable, 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.