---
title: "emailid already exists"  
description: "emailid already exists"  
author: "chetan kambli"  
published: 2016-11-15  
updated: 2016-11-16  
canonical: https://www.mindstick.com/forum/34205/emailid-already-exists  
category: "c#"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# emailid already exists

If [email](https://www.mindstick.com/articles/12870/10-easy-ways-to-manage-your-business-email-inbox) is alredy [exists](https://www.mindstick.com/forum/158947/how-do-you-use-the-exists-operator-to-check-for-the-existence-of-records-in-a-subquery) in the [database](https://www.mindstick.com/articles/12226/use-of-database-in-sencha-extjs-and-insert-record-from-user-form-using-ajax) then it should show a ms g as emailid alredy exists..i wanted to write this [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) using [asp.net](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) [ajax](https://www.mindstick.com/articles/1541/check-availability-of-user-name-or-email-using-asp-dot-net-ajax-and-jquery) or javascript...\

## Replies

### Reply by Abhishek Srivasatava

Hi Chetan,\
\

To check email exist or not you can follow this code:

```
            SqlCommand cmd = new SqlCommand("Select email from User_information where email = @email", con);            DataTable dt = new DataTable();            cmd.Parameters.AddWithValue("@email", EmailBox.Text);            SqlDataReader read = cmd.ExecuteReader();            read.Read();            if (read.HasRows)                    {                 MessageBox.Show("Email already exist ", "Error Message");                    }                    else                    {                     // ...
                    }
```

\


---

Original Source: https://www.mindstick.com/forum/34205/emailid-already-exists

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
