473,406 Members | 2,273 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,406 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 1649
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.