How to prevent duplicate entries in SQL Database using Stored procedures in C#.net
<p>I'm trying to make a simple user registration form with the following 4 fields,</p>

<ul>
<li>userid ( which is unique)</li>
<li>username ( which is unique)</li>
<li>password</li>
<li>email</li>
</ul>

<p>Now i'm able to prevent user from entering duplicate user entries in the Sql Database. But want to fire an event where the message can be successfully displayed to the user that the account 'already exists' when user provides the same userid/username or 'account creation successful' when the userid/username does not pre-exist.</p>

<p>Please provide some C# code help (asp.net) to solve this issue.
Thanks.</p>
