473,608 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

retrieve key from collection

Hello,

can anyone tell me how i retrieve the key(which i included by adding
elements) from an item in the collection?

Thanks,

Albert
Jun 19 '06 #1
4 1457
If the item you are collecting has a way of storing the key, then you
have it. Otherwise, I've searched all over the collection object - it
isn't there.
The other option you have is to subclass your own collection object and
build in the functionality yourself.

T

Albert wrote:
Hello,

can anyone tell me how i retrieve the key(which i included by adding
elements) from an item in the collection?

Thanks,

Albert

Jun 19 '06 #2
On Mon, 19 Jun 2006 14:53:26 +0200, "Albert" <al****@informa nt.nl>
wrote:
Hello,

can anyone tell me how i retrieve the key(which i included by adding
elements) from an item in the collection?

Thanks,

Albert


The general collection class does not really offer that funtionality.
If you need to work with both key and item, you likely would want to
use one of the specialized collections. Which one depends on what you
are wanting to accomplish.

Gene
Jun 19 '06 #3
Albert,

Can you clarify which collection class you're using?

Brian

Albert wrote:
Hello,

can anyone tell me how i retrieve the key(which i included by adding
elements) from an item in the collection?

Thanks,

Albert


Jun 19 '06 #4
If you use Generic.Sorted list or like, do it:

Dim strKey As String = colCollection.K eys(Index).ToSt ring

[]s
Cesar
"Albert" <al****@informa nt.nl> wrote in message
news:44******** **************@ text.nova.plane t.nl...
Hello,

can anyone tell me how i retrieve the key(which i included by adding
elements) from an item in the collection?

Thanks,

Albert

Jun 20 '06 #5

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

Similar topics

2
5231
by: Ersin Inan | last post by:
Hi All, Is there a way to get page name in asp.net code behind? I use this to log error messages in DB ( and in which page the error occured ) For instance , if it is welcome.aspx , then in C# code , I want to get this page name to store in DB ( There is a way with Request object , but I want to retrieve the name in another way ) Any help is appreciated :) Regards
0
1064
by: balamurukan | last post by:
hai, i my own collection in properties window.after cliking browse button it will show one collection editor which has 3 properties contains values(Like datagridColumnstyle collection).I wanto to retrieve the values from my collection editor. Balamurukan
0
1671
by: george_Martinho | last post by:
It seems that the ASP.NET Microsoft team didn't think about this!! The profilemanager class has the following methods: - DeleteInactiveProfiles. Enables you to delete all profiles older than a specified date. - DeleteProfile. Enables you to delete a profile associated with a specified username. - DeleteProfiles. Enables you to delete a set of profiles. - FindInactiveProfilesByUserName. Returns a collection of ProfileInfo
1
19315
by: ykong1214 | last post by:
In my project, there is a single select tag, <html:select property="userName" size="7"> <html:options collection="UserList" property="value" labelProperty="label" /> </html:select> <br><br> <input type="button" value="Select" onClick="go()">&nbsp;&nbsp;&nbsp; <input type="button" value="Cancel" onClick="cancel()"> when user choose any one and click "select" button, the value will be transfered to original window:
2
1471
by: BSamp | last post by:
I have the following business entity classes shown below. I have a data layer that retrieves the data from the database and populates a new instance of the PendingRecord class then adds it to the PendingRecords collection. i.e. PendingRecords pendingRecords = dataLayer.GetPendingRecords(); What I would like to do is to be able to have a method in the collection class that I could pass a wizardId and get the specific PendingRecord
3
3429
by: JimCinLA | last post by:
I use a place holder to load different user controls on an .aspx page. Let's call this default.aspx. Each user controls contains about a dozen different ASP.Net controls. My question is, how can I retrieve the list of controls from default.aspx?
4
1589
by: Jeff | last post by:
hey ASP.NET 2.0 I'm preparing for a certification exam on asp.net 2.0 and yesterday I took a skill assessment test on microsoft.com. One of the questions was about creating cookies. This was the question: "Which object or objects will you use to create and retrieve cookies"... 6 alternative answer were listed, below I show only 2 most relevant alternatives
6
3862
by: ashok.dhananjeyan | last post by:
Hi, Actually , I wrote one javascript to retrieve the name of the form in one particular page. what i did in this page is, <script> function checkbutton() {
5
25547
by: Ken | last post by:
I'm trying to run a loop to capture column property information from a table in my datasource. Can anybody see where this is going wrong? Dim tbl As New DataTable Dim col As DataColumn Dim x As Integer Dim colName(99) As String Dim colType(99) As String cn.Open() tbl = cn.GetSchema("Orders") 'Orders is a table in the
0
8498
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8478
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8152
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6817
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6014
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3962
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1331
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.