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


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