how to use the primary key exeception in exceptional handling?

Submitted by surendarj on
i have one registration form which consists of username, password, confirmpassword and Register button. When i will be typing the username, it should show whether the username is available or not. and i have changed the username column as primary key in sql database. and also coding for primary key exception using exceptional handling. so i need the coding for that requirement... and also how to clear the text from the form... thanks in advance.. please help me soon please send the code to my email id: [email protected]