473,320 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to have access to an element array ?

Hi,

How can I grab to a specific element value located into a string dicitionary
?
Let's say we have an string dictionary which is full and on a specific row
and need to retrieve one of the items.
I found "ContainsKey" method but when I write (within a foreach loop):

if (myStringDicArray.ContainsKey("ControlID"))

it's just returns true or false! I need to return the value in that specific
element.

Thanks in advance
Newbie
Nov 16 '05 #1
8 1645
Use indexers:

string val = (string)myStringDicArray["ControlID"];
HTH;
Eric Cadwell
http://www.origincontrols.com
Nov 16 '05 #2
Sometimes RTFM helps :
http://msdn.microsoft.com/library/de...classtopic.asp

At the bottom you find the PrintKeysAndValues2 function, it has an example
in it, namely "myCol[myKeys[i]]" where myKeys[i] is the key you're looking
for. => myStringDicArray["ControlID"]
"C# newbie" <it**************@yahoo.com> schreef in bericht
news:On*************@tk2msftngp13.phx.gbl...
Hi,

How can I grab to a specific element value located into a string dicitionary ?
Let's say we have an string dictionary which is full and on a specific row
and need to retrieve one of the items.
I found "ContainsKey" method but when I write (within a foreach loop):

if (myStringDicArray.ContainsKey("ControlID"))

it's just returns true or false! I need to return the value in that specific element.

Thanks in advance
Newbie

Nov 16 '05 #3
C# newbie <it**************@yahoo.com> wrote:
How can I grab to a specific element value located into a string dicitionary
?


See my response to your identical question from Saturday.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4

Jon, I couldn't find any response under the one I sent on Saturday.

Thanks anyway

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
C# newbie <it**************@yahoo.com> wrote:
How can I grab to a specific element value located into a string dicitionary ?


See my response to your identical question from Saturday.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #5
Eric, thanks it was a huge help.

regards
newbie
"Eric Cadwell" <ec******@ns.insight.com> wrote in message
news:O2**************@tk2msftngp13.phx.gbl...
Use indexers:

string val = (string)myStringDicArray["ControlID"];
HTH;
Eric Cadwell
http://www.origincontrols.com

Nov 16 '05 #6
C# newbie <it**************@yahoo.com> wrote:
Jon, I couldn't find any response under the one I sent on Saturday.


Can you see your actual post from Saturday? Can you see other posts
from Saturday?

Before asking a question again, I'd always suggest checking on
groups.google.com for answers you may have missed. In this case a
simple subject search for "about StringDictionary" finds exactly one
thread, which is the one you posted, including my response.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #7

Ok, thanks I'll try it on google. I appreciate your help

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
C# newbie <it**************@yahoo.com> wrote:
Jon, I couldn't find any response under the one I sent on Saturday.


Can you see your actual post from Saturday? Can you see other posts
from Saturday?

Before asking a question again, I'd always suggest checking on
groups.google.com for answers you may have missed. In this case a
simple subject search for "about StringDictionary" finds exactly one
thread, which is the one you posted, including my response.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #8

Ok, thanks I'll try it on google. I appreciate your help

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
C# newbie <it**************@yahoo.com> wrote:
Jon, I couldn't find any response under the one I sent on Saturday.


Can you see your actual post from Saturday? Can you see other posts
from Saturday?

Before asking a question again, I'd always suggest checking on
groups.google.com for answers you may have missed. In this case a
simple subject search for "about StringDictionary" finds exactly one
thread, which is the one you posted, including my response.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 16 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: maciej | last post by:
I got an array that consists of elements that are arrays also. Now I wish I could add an element to the middle of it. Let mi give you an example: array ( - array(1,15,apple), -...
13
by: Noah Spitzer-Williams | last post by:
Hello guys, I would like to do something seemingly simple: find out if an element in an array that is passed to my function exists. I used to think I could just do: if (arr) ... However, if...
24
by: David Mathog | last post by:
If this: int i,sum; int *array; for(sum=0, i=0; i<len; i++){ sum += array; } is converted to this (never mind why for the moment):
9
by: Luke Wu | last post by:
Hello, I'm having some problems understanding 2 dimensional arrays. My problem relates to the following code: #include <stdio.h> #define M 3 #define N 3
14
by: Mike | last post by:
I had a question about threading and access to private class variables. I am developing a windows service which has a class inside of it which will receive various asynchronous calls to it via...
3
by: SM | last post by:
Hello, Im trying to access elements in my XML file using the JavaScript DOM but i'm not sure how. I use AJAX to access the XML and then use the responseXML property to access the XML file data. I...
6
by: Urs Thuermann | last post by:
With offsetof() I can get the offset of a member in a struct. AFAICS, it is portable and clean to use this offset to access that member. I need to do something like this struct foo { struct...
7
by: =?utf-8?B?5YiY5piK?= | last post by:
Hi, folks, Is it possible to delete an element from a sorted array with O(1) time? Best regards
4
by: Harry | last post by:
Hi Guys I dont really know how to do this: if there are a page of others, some data are embedded inside the data array like this: <script language="JavaScript" type="text/javascript"> <!-- var...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.