views:

95

answers:

2

hey i want to know if anyone can tell me how to delete duplicate records or avoid duplication in the first place....

the problem is that whenever i edit a record, a duplicate record is created.

can anyone please send an answer??

+1  A: 

The general approach to avoiding duplicates, regardless of language, is to use a hashtable to store your records. This assumes there is a field which serves as a unique identifier. Doctor Dobb's Journal as an article on C++ and hashing.

Kelly French
+2  A: 

Try to use std::map or std::set collections. They don't store duplicates. Some containers have methods like unique() or you can just use unique() or unique_if() algorithms. By the way where do you duplicate records? Is it a problem with ado(.net) usage or maybe with some specific collection you use? Where do you see duplicated records? In memory, in db or maybe in some file?

Alek

Alex Stankiewicz