By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,740 Members | 790 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,740 IT Pros & Developers. It's quick & easy.

Check the duplicate values in Dataset

P: 76

I hava a set of records in Dataset. I want to check the duplicate values which is present in the dataset. Plz help me with sample code..

thanks in advance...

Oct 16 '07 #1
Share this Question
Share on Google+
5 Replies

Shashi Sadasivan
Expert 100+
P: 1,435
Loop through your dataset and rescan it for any similar rows.
That would be your best option.

We will not be able to provide you with any code, (unless someone has a link to some site providing anything similar)
However if you do face issues while coding it, we will be glad to debug it for you.
(Cant expect someone else to do your job completely, can you?)
Oct 16 '07 #2

P: 71
You wil be fetching the values from the table rite? So u can give a proper query that tells to take only the distinct values to fill the dataset.
Or you can check(scan) ur dataset by a set of codes.

Oct 16 '07 #3

P: 76

I have more then 1 lake records in my oracle DB. I want to insert nearly 100 records from datagrid to DB. The condition is that i have to check the duplicate record ie the datagrid record should be checked to DB if duplicate record found an error message should be displayed....

Can some one give me the idea how to solve this problum.... If possible help me with sample code....

Thanks in advance...

with reg
Oct 16 '07 #4

Expert 2.5K+
P: 3,235
Hi Inba,
I have merged your two threads which ask identical questions. This will prevent any confusion in the future, and allow experts to collaborate on answering your question, rather than being divided with some answering in one thread and others in another.
Oct 16 '07 #5

Expert 5K+
P: 7,872
Set a constraint on your table demanding that the recordset (say column2, column3 and column4) must be unique.
Then you CANNOT insert a duplicate record, and it will throw a nice exception that you can catch.
Oct 16 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.