Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a dataset in with three columns

code desc price
black abc 20.00
white cbd 25.50
blue mnb 30.00


I want check duplicate record of textbox on button click of aspx form in dataset using jquery and display an alert if duplicate value exist in dataset.


how can i achieve this task

please help me


thanks in advance
Posted
Comments
Kornfeld Eliyahu Peter 4-Feb-14 5:43am    
You question makes no sense! You mixing server and client side with no mercy...
Please review the question and clarify it...
Ravi Sargam 4-Feb-14 5:53am    
Can i use Dataset in Jquery or not?
Kornfeld Eliyahu Peter 4-Feb-14 5:56am    
DataSet as System.Data.DataSet? NO!!!
jQuery belongs to client side - DataSet is to the server side...
It seems to me that you confused about how a web site build up - please search for some basic books!
thatraja 4-Feb-14 8:10am    
Always answer all our questions to give you perfect/recommended answers

Agree with Kornfeld. Do it either on server side or client side. Don't mix things. I give you samples, customize it.
Server side - Checking Existing Records Using Array of Data Rows[^]
Client side - JQUERY: Mark rows with identical values in a table[^]
Searching table rows with jQuery[^]
 
Share this answer
 
I am assuming
Duplicate means the entire row matches with an entire row, not only cells
You want to show the message after all the rows are filled, not after each row

I would suggest the following in javascript
1. For each row concatenate values of the 3 cells into one string
2. Get all these strings into one string array
3. Use code like this[^] to find out the duplicate entries and highlight those rows on your screen. You can also find many other such code snipets in JS to find out duplicate entries.

[Please encourage participation by accepting/up-voting answers or solutions that work for you]
 
Share this answer
 
Comments
Ravi Sargam 4-Feb-14 6:11am    
thanks..
CoderPanda 4-Feb-14 6:25am    
Thanks for accepting it as a solution. But I am not sure if you or someone else downvoted it and why. I would like to know so that I can improve my answer.
Kornfeld Eliyahu Peter 4-Feb-14 6:27am    
IMHO, as misleads as the question is. Where in you answer the DataSet comes in? Are you really think that this is a solution to check duplicate values in a data set (whatever type it has) - loop over table rows and cells to create hash of string!!! Move data related processes to data layer, keep UI in UI and know your framework!!!
CoderPanda 4-Feb-14 6:40am    
Hello Kornfield, thanks for your valuable suggestions. I can think of the following without being sure about them:
1. The OP actually mentioned dataset but didn't really mean the c# ado.net dataset. He may just mean his data items as a whole.
2. The realtime need of a solution many a times outweigh the actual solution. So as long as the OP is benefited with it should we really complain. Of course I don't guarantee that my solution is 100% and I am just trying to help. And I think the OP's job is to ensure the solution actually fits into his overall design/architectre and the broad scheme of things.

Please let me know if you think this is a valid approach.
Kornfeld Eliyahu Peter 4-Feb-14 6:46am    
IMHO giving a quick-and-dirty solution alone as a kind of crime!
If you not sure about the exact question - do not answer it! Ask for clarification.
If you after all answer it - do some good on the way and lit the light in the OP's brain...
You have the power!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900