Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I am work on Telerik Winform c#.

I have face issue as that on my win form when i do an action like button click then the data of database are repeated as how many time i click on my button.

why i face this situation.

once i delete the repeated data from database as well.

But again it was happened.

so plz can anyone tell me that why this happen and what will be the solution for that.

Thanks.
Posted

It depends on what action you're doing in the button. For example if you're inserting data within the button code then it sounds that you don't have proper keys in the database and checks in the application to notice that you're generating a duplicate data. In such case you would insert the same row over and over again. To prevent duplicate data, use constraints such as primary key or unique key. For more info, see http://en.wikipedia.org/wiki/Unique_key[^]

If you're fetching data then you probable have a problem in the query like a missing join which would cause a cross join or other missing definitions in the WHERE clause.
 
Share this answer
 
Hi,

Here by clicking the button you are making the request again and again. Instead you should keep some duplicate record check at the database level and restrict the duplicate entry of your data, make sure that once the button is clicked and the data is entered into the database al the controls should be reset to avoid duplicate entry. Or you can restrict the button to click multiple times while one request is processing.

Thanks
Sisir Patro
 
Share this answer
 

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