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
http://forum.xhanch.com/index.php/topic,3075.0.html

Incoming Search Terms

c# associative array, associative array c#, net associative array, associative array in c sharp, c# associative arrays, c sharp associative array, associative array in c#, associative array in net, csharp associative array, associative array c sharp, associative array NET, net associative arrays, c# named array, Associative Arrays in C#, c# associated array, associative array csharp, c associative array, c# Script array, c# net associative array, c net associative array, associative arrays c#, net named array, net associative array guid, csharp assoc array, associative arrays in c sharp, c# associative arraylist, c# associative array hashtable, named array C#, c# array associativi, c# assoc array, c# associate array, csharp foreach associative array, net collections generic dictionary<object object>, associated array in c#, csharp associative arrays, associate array in C#, c# key value array, c# foreach associative array, associative arraylist, c# named arrays, associative arrays c sharp, how to make associative array in c#, creating associative array in c#, convert php associative array to net, how to create an associative array in c#, foreach associative array in c#, how to associate 2 arrays in c#, convert json to c# class dictionaries (associative arrays), foreach c# associative array, convert javascript associative array to c# dictionary, csharp associative arrayx, csharp named array, csharp php arrays named, csharp associative list, csharp for each associative array, cast associative array to hashtable c#, how to use associative array in c sharp, public class associativearray, net new associative array, net screept c#, net static associative array, plugins for dictionary in c, print associative array c#, raport z array list c#, return a javascript associative array from CSharp, script sharp assosiative arrays javascript, script sharp net, use of associative array in c#, using associative array in c sharp, net named array<, net managed object to javascript associative array, net hashed array, indexed array c# net, knockoutjs associative array, named array in csharp, named arrays in c#, named indexed array c#, namedarray C#, net Array string key, net associate array, net associated array, net c associative array, net class associated arrays, net flexible array, vettori associativo c#, array associativo c#, 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#, assoziative arrays c#, associative array net 4, 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
Code, Associative Array, Associative, C#.NET, Flexible, Array, Script, .net, Expandable, Free, Hashtable, Dictionary, C#, Element, 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.