Solved

Need to add objects to array without creating duplicates

Posted on 2008-10-18
3
257 Views
Last Modified: 2013-12-17
I am building a RFID inventory project.  I need to track RFID tags passing several antenna's.  RFID tags will be read several times approx 40+ times as they pass an antenna.  I need to be able to build an object with various information from the RFID read without it duplicating tag information so that I can add it to a database without causing duplicate entries and/or un needed database access.  In the perl world I would just assign a tag to say $rfid{$tagid} = "something" which would keep duplicates from being an issue using a HASH.  Is there something similar that can be done in C# or even a better way?

A bit of code would be most desirable but at least a link to some useful information would be greatly appreciated.
0
Comment
Question by:Tekati68
3 Comments
 
LVL 16

Accepted Solution

by:
CuteBug earned 250 total points
ID: 22749313
0
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 250 total points
ID: 22771077
You can use an List <T> for that
In a list you can use the contains to see whether the value exists or not by .Contains()

MSDN
http://msdn.microsoft.com/en-us/library/6sh2ey19(VS.80).aspx
0
 

Expert Comment

by:trenstar
ID: 22840585
Hi Tekati68

I am interested in how you read RFID tags?
Are you able to lock the tags in order to stop other readers / users from reading your tags and modifying the data on the tag?

Currently using Sirit reader with the GEN 2 tags, but when I lock the fields on the tags (kill, access, tid, tag_id, user_data), I am still able to read the tag without the new access password.
All this in C# and using the RAPID sdk.

Hop you can help!

Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now