0

Hello
I want to array with key and valu in vb.net
as like in php

$array['name']="xyz";
$array['surname']="abc";

so is this possible ?
please any suggestion.

Thanks in advance

3
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by PisqoLoq
0

Hello
I want to array with key and valu in vb.net
as like in php

$array['name']="xyz";
$array['surname']="abc";

so is this possible ?
please any suggestion.

Thanks in advance

>I want to array with key and valu in vb.net
as like in php. so is this possible ?

No

You may use Hashtable class from System.Collections namespace for that purpose. Hashtable instance represents data in key-value pair form.

Here is a sample:

.....
        Dim rec As New System.Collections.Hashtable
        rec.Add("roll", 10)
        rec("name") = "Ronny"
        rec("bdate") = Date.Parse("12-31-1990")

        For Each n In rec.Values
            Console.WriteLine(n)
        Next
        .....
0

Thank you
i dont know this m php programer only so........

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.