Ok - After comments we discovered that the issue is in the button double click (a click by the user after the first post but before the page reloads)
There are two (main) ways to solve this:
1: disable the button after the first click
2: sanitize the data before inserting.
If you are a developer worth your salt, then you should do both!
ok. first how to disable a button after the first click. This needs to be done via javascript. I can be done at the server side but that's just hiding functionality the user should be able to see.
function preventSecondClick(button){
$(button).click(function(e){
e.preventDefault;
});
}
Add this to your buttons onclientclick: OnClientClick="preventSecondClick(this);". It will change the click event to prevent postbacks, but will still postback the current click.
Second: Sanitize your data. You say that you are using a Stored Proc to insert? Then data sanity is easy:
insert into table (a,b,c)
select @a,@b,@c
where not exists (select * from table where a = @a AND b = @b AND c=@c)
This will not insert a value that already exists. When you execute this from VB you would use ExecuteNotQuery(cmd) which will return an int. The int is the number of rows affected. If 0 then the data is not inserted, if 1 then it is. You can use this to flag possible issues, but it's not required.
Hope that helps.
let me know how you get on ^_^
Andy