I am new to asp.net with C#. Now I need a solution for one issue.
In PHP I can create an array like this:
$arr[] = array('product_id' => 12, 'process_id' => 23, 'note' => 'This is Note');
//Example
Array
(
[0] => Array
(
[product_id] => 12
[process_id] => 23
[note] => This is Note
)
[1] => Array
(
[product_id] => 5
[process_id] => 19
[note] => Hello
)
[2] => Array
(
[product_id] => 8
[process_id] => 17
[note] => How to Solve this Issue
)
)
I want to create the same array structure in asp.net with C#.
Please help me to solve this issue.
Use a
Dictionary<TKey, TValue>for quick lookups of a value (your object) based on a key (your string).To simplify the
Addoperation, you could use collection initialization syntax such asEdit
With your update, I would go ahead and define a proper type to encapsulate your data
And then create an array or list of that type.
And then you have a list of strongly-typed objects you can iterate over, bind to controls, etc.