title: Validation error while inserting Data to sql server
body: <p>I am new in asp.net development.
  I am trying to make a webpage using asp.net and SQL server 2008.
  Just a simple page through which data will be inserted to the database. But I noticed it is taking duplicate records as well. So I used "Unique" constraint while the respective table and it is working fine.
  But I wanted to show an error message which says "DATA already exists" after I am clicking the Insert button on the page.
  Is it possible to check for duplicate entries and show the error while we are inserting data to a database?
  without java-script or ajax please.
  Please help with a code snippet.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Regards.</p>