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


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