how to check if an email address already exists in the database in asp.net

Advertisement
In this article we can see how to find exiting email id from data base and it will display error message if it already exits
We created a method with name uniqueEmail.
Established a connection to the database.
Getting the data from the table  aspnet_Membership.
Using the ExecuteReader to read the values and checking the condition weather email id is already exists or not.


   public bool uniqueEmail()
        {
            
                string iemail;
                string constr = ABCDataAccessLayer.ABCConnctionString; // connection string
                SqlConnection con = new SqlConnection(constr);
                con.Open();
                string query = "select count(Email) as Email  from aspnet_Membership where Email= '" + txtEmailID.Text + "'";
                SqlCommand cmd = new SqlCommand(query, con);
                SqlDataReader dr;
                dr = cmd.ExecuteReader();
                while (dr.Read())
                {
                    iemail = dr["Email"].ToString();
                    if (iemail != "0")
                    {
                        mailerror.Text = "Enter different email id";
                        return false;
                    }
                   
                }

                return true;
            
        }



Keep if condition,if you want to check email in insert mode or update mode
if (uniqueEmail())
{
Insert Code logic //
or
Update Code Logic
}

Output:
Advertisements
SHARE

Unknown

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

58 comments:

  1. I started on SharePoint around and have gone through the same denials, acceptance, and now really loving the vast landscape of SharePoint. There is so much to learn, so many real world problems to solve, and so many fantastic ways to solve them.
    SharePoint Online Training

    ReplyDelete
  2. Nice knowledge gaining article. This post is really the best on this valuable topic. UC mini app

    ReplyDelete
  3. i want this code in mvc without entity framework

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. Really I Appreciate The Effort You Made To Share The Knowledge. This Is Really A Great Stuff For Sharing. Keep It Up . Thanks For Sharing.

    Cloud Training
    Cloud Training in Chennai

    ReplyDelete
  6. Great post, thank you for sharing. I want to add one more tool to your collection: improver.io. It's my favorite Chrome extension for contact finding.find email from linkedin

    ReplyDelete
  7. In fact, the system is considered to be so important that it's now considered a necessary part of any modern database systems.dbdesigner.net

    ReplyDelete
  8. I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... correo hotmail

    ReplyDelete
  9. Wow, What an Outstanding post. I found this too much informatics. It is what I was seeking for. I would like to recommend you that please keep sharing such type of info.If possible, Thanks. sign in to Hotmail

    ReplyDelete
  10. i never know the use of adobe shadow until i saw this post. thank you for this! this is very helpful. www.hotmail.com

    ReplyDelete
  11. This was really an interesting topic and I kinda agree with what you have mentioned here!
    company email

    ReplyDelete
  12. thank you for this such a good information about hotmail email login on www.hotmail.com

    ReplyDelete
  13. I’m happy I located this blog! From time to time, students want to cognitive the keys of productive literary essays composing. Your first-class knowledge about this good post can become a proper basis for such people. nice one www.hotmail.com

    ReplyDelete
  14. I am always searching online for articles that can help me. There is obviously a lot to know about this. I think you made some good points in Features also. Keep working, great job ! https://hotmail-account.email

    ReplyDelete
  15. This article was written by a real thinking writer without a doubt. I agree many of the with the solid points made by the writer. I’ll be back day in and day for further new updates. Hotmail é um serviço de webmail gratuito

    ReplyDelete
  16. Actually I read it yesterday but I had some thoughts about it and today I wanted to read it again because it is very well written. buy high quality kratom

    ReplyDelete
  17. Below you will understand what is important, the idea provides one of the links with an exciting site: grossiste fleurs

    ReplyDelete
  18. I think I have never seen such blogs ever before that has complete things with all details which I want. So kindly update this ever for us.

    Data Science Course

    ReplyDelete
  19. Well we really like to visit this site, many useful information we can get here.

    Data Science Training

    ReplyDelete
  20. Interesting post. I Have Been wondering about this issue, so thanks for posting. Pretty cool post.It's really very nice and Useful post.Thanks..

    Data Science Courses

    ReplyDelete
  21. The web site is lovingly serviced and saved as much as date. So it should be, thanks for sharing this with us.

    Data Science Certification

    ReplyDelete
  22. Really I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post. best email marketing services

    ReplyDelete
  23. Stupendous blog huge applause to the blogger and hoping you to come up with such an extraordinary content in future. Surely, this post will inspire many aspirants who are very keen in gaining the knowledge. Expecting many more contents with lot more curiosity further.

    Digital Marketing Course in Bhilai

    ReplyDelete
  24. Fantastic blog extremely good well enjoyed with the incredible informative content which surely activates the learners to gain the enough knowledge. Which in turn makes the readers to explore themselves and involve deeply in to the subject. Wish you to dispatch the similar content successively in future as well.

    artificial intelligence training in bhilai

    ReplyDelete
  25. Impressive blog to be honest definitely this post will inspire many more upcoming aspirants. Eventually, this makes the participants to experience and innovate themselves through knowledge wise by visiting this kind of a blog. Once again excellent job keep inspiring with your cool stuff.

    Data Science certification in Bhilai

    ReplyDelete
  26. Tremendous blog quite easy to grasp the subject since the content is very simple to understand. Obviously, this helps the participants to engage themselves in to the subject without much difficulty. Hope you further educate the readers in the same manner and keep sharing the content as always you do.

    Data Science Course in Raipur

    ReplyDelete
  27. Stupendous blog huge applause to the blogger and hoping you to come up with such an extraordinary content in future. Surely, this post will inspire many aspirants who are very keen in gaining the knowledge. Expecting many more contents with lot more curiosity further.

    Digital Marketing Course

    ReplyDelete
  28. Fantastic blog extremely good well enjoyed with the incredible informative content which surely activates the learners to gain the enough knowledge. Which in turn makes the readers to explore themselves and involve deeply in to the subject. Wish you to dispatch the similar content successively in future as well.

    artificial intelligence course in raipur

    ReplyDelete
  29. You have outdone yourself this time. It is probably the best, most short step by step guide that I have ever seen. how to send mass email

    ReplyDelete
  30. Stupendous blog huge applause to the blogger and hoping you to come up with such an extraordinary content in future. Surely, this post will inspire many aspirants who are very keen in gaining the knowledge. Expecting many more contents with lot more curiosity further.

    Data Science certification in Raipur

    ReplyDelete
  31. Extraordinary blog went amazed with the content that they have developed in a very descriptive manner. This type of content surely ensures the participants to explore themselves. Hope you deliver the same near the future as well. Gratitude to the blogger for the efforts.

    Digital Marketing training

    ReplyDelete
  32. Extraordinary blog went amazed with the content that they have developed in a very descriptive manner. This type of content surely ensures the participants to explore themselves. Hope you deliver the same near the future as well. Gratitude to the blogger for the efforts.

    Digital Marketing training

    ReplyDelete
  33. Fantastic blog extremely good well enjoyed with the incredible informative content which surely activates the learners to gain the enough knowledge. Which in turn makes the readers to explore themselves and involve deeply in to the subject. Wish you to dispatch the similar content successively in future as well.

    Data Science training in Bhilai

    ReplyDelete
  34. Email marketing is a power to deal with. It has different advantages which can be used according to require. The significant level of personalization alongside the different sorts that the basic email can transform into has made it a flexible instrument. b2b marketing email list

    ReplyDelete
  35. I want to thank you for your efforts in writing this article. I look forward to the same best job from you in the future.

    Data Science Course

    ReplyDelete
  36. I think this is one of the most significant information for me. And i’m glad reading your article. But should remark on some general things, آدرس جدید سایت گاد بت

    ReplyDelete
  37. Truly mind blowing blog went amazed with the subject they have developed the content. These kind of posts really helpful to gain the knowledge of unknown things which surely triggers to motivate and learn the new innovative contents. Hope you deliver the similar successive contents forthcoming as well.

    Digital Marketing Course

    ReplyDelete
  38. Stupendous blog huge applause to the blogger and hoping you to come up with such an extraordinary content in future. Surely, this post will inspire many aspirants who are very keen in gaining the knowledge. Expecting many more contents with lot more curiosity further.

    Data Science training in Raipur

    ReplyDelete
  39. Tremendous blog quite easy to grasp the subject since the content is very simple to understand. Obviously, this helps the participants to engage themselves in to the subject without much difficulty. Hope you further educate the readers in the same manner and keep sharing the content as always you do.

    Digital Marketing Course in Bhilai

    ReplyDelete
  40. Terrific post thoroughly enjoyed reading the blog and more over found to be the tremendous one. In fact, educating the participants with it's amazing content. Hope you share the similar content consecutively.

    Data Science training in Bhilai

    ReplyDelete
  41. The real abilities are very straightforward - you probably as of now have them dominated. What you need to realize is the PROCESS. That takes a brief period, yet honestly not unreasonably much. SMM Panel

    ReplyDelete
  42. I want to say thanks for beautiful blog sharing with us. Your blog really great resource to update my knowledge. سایت تتل بت

    ReplyDelete
  43. Highly appreciable regarding the uniqueness of the content. This perhaps makes the readers feels excited to get stick to the subject. Certainly, the learners would thank the blogger to come up with the innovative content which keeps the readers to be up to date to stand by the competition. Once again nice blog keep it up and keep sharing the content as always.

    Data Science training in Bhilai

    ReplyDelete
  44. Wonderful blog found to be very impressive to come across such an awesome blog. I should really appreciate the blogger for the efforts they have put in to develop such an amazing content for all the curious readers who are very keen of being updated across every corner. Ultimately, this is an awesome experience for the readers. Anyways, thanks a lot and keep sharing the content in future too.

    Digital Marketing training in Bhilai

    ReplyDelete
  45. Really wonderful blog completely enjoyed reading and learning to gain the vast knowledge. Eventually, this blog helps in developing certain skills which in turn helpful in implementing those skills. Thanking the blogger for delivering such a beautiful content and keep posting the contents in upcoming days.

    Data Science Course in Raipur

    ReplyDelete
  46. Truly incredible blog found to be very impressive due to which the learners who ever go through it will try to explore themselves with the content to develop the skills to an extreme level. Eventually, thanking the blogger to come up with such an phenomenal content. Hope you arrive with the similar content in future as well.

    Digital Marketing Course in Raipur

    ReplyDelete
  47. Really wonderful blog completely enjoyed reading and learning to gain the vast knowledge. Eventually, this blog helps in developing certain skills which in turn helpful in implementing those skills. Thanking the blogger for delivering such a beautiful content and keep posting the contents in upcoming days.

    Data Science certification in Raipur

    ReplyDelete
  48. Truly incredible blog found to be very impressive due to which the learners who ever go through it will try to explore themselves with the content to develop the skills to an extreme level. Eventually, thanking the blogger to come up with such an phenomenal content. Hope you arrive with the similar content in future as well.

    Digital Marketing training in Raipur

    ReplyDelete
  49. Highly appreciable regarding the uniqueness of the content. This perhaps makes the readers feels excited to get stick to the subject. Certainly, the learners would thank the blogger to come up with the innovative content which keeps the readers to be up to date to stand by the competition. Once again nice blog keep it up and keep sharing the content as always.

    Data Science Course in Bhilai

    ReplyDelete
  50. Wonderful blog found to be very impressive to come across such an awesome blog. I should really appreciate the blogger for the efforts they have put in to develop such an amazing content for all the curious readers who are very keen of being updated across every corner. Ultimately, this is an awesome experience for the readers. Anyways, thanks a lot and keep sharing the content in future too.

    Digital Marketing training

    ReplyDelete
  51. Amazing, this is great as you want to learn more, I invite to This is my page. why hack a phone

    ReplyDelete
  52. Truly incredible blog found to be very impressive due to which the learners who ever go through it will try to explore themselves with the content to develop the skills to an extreme level. Eventually, thanking the blogger to come up with such an phenomenal content. Hope you arrive with the similar content in future as well.

    Digital Marketing Course in Raipur

    ReplyDelete
  53. Highly appreciable regarding the uniqueness of the content. This perhaps makes the readers feels excited to get stick to the subject. Certainly, the learners would thank the blogger to come up with the innovative content which keeps the readers to be up to date to stand by the competition. Once again nice blog keep it up and keep sharing the content as always.

    Data Science certification in Bhilai

    ReplyDelete
  54. Deciding on a brand name is one of the common mistakes of startup companies. Having names that is thoroughly thought off is an edge that can lead your company to success. Email Extractor

    ReplyDelete