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, associative array in c#, c sharp associative array, associative array c sharp, associative array in net, csharp associative array, associative array NET, net associative arrays, c# named array, Associative Arrays in C#, c# associated array, associative array csharp, net named array, associative arrays c#, c associative array, c net associative array, c# net associative array, c# Script array, associate array in C#, associated array in c#, associative arraylist, associative arrays c sharp, associative arrays in c sharp, net collections generic dictionary<object object>, c# array associativi, c# assoc array, c# associate array, c# associative array hashtable, c# associative arraylist, c# foreach associative array, net associative array guid, c# key value array, c# named arrays, csharp assoc array, csharp associative arrays, csharp foreach associative array, named array C#, array associate in c#, array associativo c#, Assiciative array C#, vettori associativo c#, assoc array in c#, assoc array net, associate array c#, associate array net, associated array c#, associated arrays in c#, associateve array csharp, associative array c shapr, associative array c# arraylist, associative array in c, Associative array list 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, associative lists c#, associativeArray C#, assosiated array in C#, assoziative arrays c#, c net associative array key, c net associative arrays, c sharp asscoaitivate array, c sharp foreach associative array, c sharp keyed array, c ассоциативные массивы, c# array associatif, c# array associative, c# array associativo, C# associative arraty, c# associative array foreach, c# associative array NET 3 5, c# associative array quick, c# associative collections, C# class return associative array, C# create associative array, c# create associete array, c# create assozitve array, c# dictionary data plugins, c# dictionary to array, c# foreach assoziatives array, c# get keys of associative array, C# Keyed Array, C# keyed array of counts, c# net php post creating associative array, C# как уничтожить переменную#, cast associative array to hashtable c#, convert javascript associative array to c# dictionary, convert json to c# class dictionaries (associative arrays), convert php associative array to net, csharp associative arrayx, csharp associative list, csharp for each associative array, csharp named array, Xhanch, Xhanch Studio


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