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

72 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. 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
  6. 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
  7. 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
  8. 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
  9. This was really an interesting topic and I kinda agree with what you have mentioned here!
    company email

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

    ReplyDelete
  11. 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
  12. 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
  13. 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
  14. 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
  15. Below you will understand what is important, the idea provides one of the links with an exciting site: grossiste fleurs

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

    Data Science Training

    ReplyDelete
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. I want to say thanks for beautiful blog sharing with us. Your blog really great resource to update my knowledge. سایت تتل بت

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

    ReplyDelete
  26. learn how to hack into my husband’s WhatsApp account, that why we are here to guide you are you can easily access your partner or husband WhatsApp.

    click here on how to monitor your spouse whatsapp messages

    ReplyDelete
  27. Hire a hacker today to hack all type of phone
    https://hackactivities.com

    ReplyDelete
  28. Email promoting administrations give viable and simple approach to get accomplishes wanted advertising objectives. Through Email benefits your message or administrations is shipped off clients. It's likewise assists with developing relationship with the clients by customized and pertinent email correspondences. Email showcasing is a best and least expensive approach to disseminate your business messages to clients or public portion by means of mailer (email). what is email marketing


    ReplyDelete
  29. You bear through a awesome vacancy. I sanity definitely quarry it moreover personally suggest to my buddys. I am self-possessed they determination be benefited from this scene. email scrubber

    ReplyDelete
  30. I use only high quality materials - you can see them at: LinkedIn Scraper

    ReplyDelete
  31. wow this saintly however ,I love your enter plus nice pics might be part personss negative love being defrent mind total poeple , are speaking

    ReplyDelete
  32. When spying on cell phone all you need is a specialist that can really help with a Good spy app

    ReplyDelete
  33. One of the most popular school information platforms is PowerSchool. PowerSchool is known to have carried a vulnerability which we at Pro hackers have exploited a lot. This allows an attacker to list the content of the admin folder via a specially crafted URL. The impact of this vulnerability depends on the settings of the Web server and what the folder contains. hacker for hire
    From this, we can access the database from single security flaws.

    ReplyDelete
  34. I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. Zendable

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

    ReplyDelete
  36. A big thank you for your article post. Really looking forward to read more. Much obliged.instagram video downloader

    ReplyDelete
  37. Nice Information. Keep Posting such informative blogs.
    Full stack classes in Pune

    ReplyDelete
  38. infomative blog, keep posting . If you want to learn about java web developer then checkout java course in pune

    ReplyDelete
  39. Verify the authenticity of the check before attempting to cash it.
    7-Eleven check cashing services

    ReplyDelete
  40. In ASP.NET, you can check if an email address already exists in the database by executing a query to search for the email address Here. You can use SQL queries or Entity Framework to perform this task efficiently. Remember to handle potential exceptions and sanitize user input to ensure security.

    ReplyDelete

Labels

.Net Interview Questions add custom button in sharepoint using javascript Add custom column property into a PageLayout in SharePoint Add Page Title on their browser's title bar in SharePoint Customly add zip files in blogger Add-SPOSiteCollectionAppCatalog : Must have Manage Web Site permissions or be a tenant admin in order to add or remove sites from the site collection app catalog allow list Advance SmartObject An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL. Angular 2 Angular JS Angularjs Angularjs 1 anonymous users accessing lists and libraries App Permissions for SharePoint 2013 asp.net membership unique email Asp.net TreeView Control asp.net. Attendees in SharePoint Auto refresh list using Content Editor WebPart in SharePoint 2013. Auto Refresh SharePoint list using JavaScript Block and unblock of attachment types in SharePoint Blogger C# Callouts in SharePoint 2013 Cascading Dropdown list in SharePoint change onenote to another location. change SuiteBarLeft in SharePoint 2013 check if userid exists in database c# click node text to expand/collapse in Treeview client object model Close webpart CQWP crate chart using BI site in PPS Create a modern team site collection in SharePoint online Create BI chart in PPS SharePoint 2013 create filter in dashboard designer. create kpi's in dashboard designer create kpi's in SharePoint 2013 dashboard designer Create List Create List In SharePoint Create List using Power Shell Script Create Lookup Field in List using Power Shell Script Create lookup field in List create SharePoint List custom view. create SharePoint List views in List Schema create site collection in site collection in SharePoint using powershell created Date Time calculated field in SharePoint Cross site Collection in SharePoint 2013 Crud Operation in Asp.net Using Stored Procedure Custom MasterPage Approval in SharePoint custom view for survey list Customly add SharePoint List view in Page. delete items in sharepoint using powershell Difference between Angular 1.x & Angular 2 difference between Office 365 and Windows Azure difference between Windows Azure and Office 365 in sharepoint? DifferenceBetween discussion board Display Data in Grid View display radio buttons and choice fields horizontally in SharePoint 2013 Document library DotNet Drag and drop documents in document library in SharePoint dynamically populating values from one list to another list using jquery in sharepoint edit and delete buttons in datagridview Edit Links email notification using Nintex enable anonymous access in SharePoint 2013 enable app catalog sharepoint online site collection powershell Enable appcatalog site collection level using PowerShell based on Input file Enable versions for list and library except the hidden lists using PowerShell Script Error occurred in deployment step 'Recycle IIS Application Pool': Cannot resolve model for the project package Errors&Solutions Export document library in sharepoint using powershell Export particular Group in Term Store Management in SharePoint 2013 Export to Excel first release Flow Flow features free disk space on servers using powershell Friendly URLs and Managed Navigation in SharePoint 2013 get a list of site collection with template in web application using PowerShell Script in SharePoint Get attachments in SharePoint custom list using c# get current list item id sharepoint programmatically Get current url using jquery Get data from SharePoint list using Rest api & Angular JS Get Random Get Random SharePoint items using PowerShell Get Random values from SharePoint list using PowerShell Get url of the last value using jquery Get-SPOSite : The managed path sites/yoursitename is not a managed path in this tenant. Getting Email From User Hide “Edit Links” in left navigation SharePoint 2013 hide button in sharepoint based on permissions Hide column in SharePoint List view hide fields using client side object model Hide list in Quick Launch in SharePoint using PowerShell How to add Custom Tiles to SharePoint site Page. How to add extension files in Search Navigation in SharePoint 2013 How to Add Multiple users Using SharePoint People Picker How to add SharePoint list view in Page using C# How to Approve MasterPage using PowerShell in SharePoint How to bind Multiple users Using SharePoint People Picker how to change indicators on kpi performance how to check if an email address already exists in the database in asp.net how to configure workflow manager platform for SharePoint 2013 how to create calculated value using powershell how to create certificate in SharePoint How to create flow. how to create gantt chart webpart in sharepoint how to create KPI indicators in Dashboard designer How to create moden communication site in SharePoint online How to create Multi selected filter in Dashboard How to create nintex workflow in sharepoint how to create rdlc reports in asp.net How to Display Data Grid View in ASP.net How to enable anonymous access in SharePoint How to find data in datagridview in c# How to get image names from the folder using C# how to get particular list content type id in SharePoint 2013 How to get QueryString value in SharePoint WebPart Programatically how to get the current item id for newly created item using REST API and JQuery how to hide list in sharepoint how to know who created list in sharepoint How to make a Site Collection Read-Only in SharePoint 2010 How to overlay Office 365 shared calendar on SharePoint Site how to pass jquery value to asp.net textbox control How to pass pagename as a browser's title bar in the page how to remove unused Application Pool in SharePoint how to remove zone using powershell script How to send mail to particular group of people using PowerShell how to update modified by and created by using powershell how to uplaod RAR files in blogger import csv data into sharepoint import data using powershell Import group to term store management using SharePoint 2013. InfoPath InfoPath Cascading Dropdown list Insert update delete in datagridview in C# winforms Integration from SharePoint to k2. K2 Smart Forms for SharePoint JavaScript Injection jquery JSON K2 blackpearl K2 Designer K2 Designer Workflow. K2 smartform cascading dropdown list k2 Workflow K2 workflow to send a mail with PDF left navigation Local Term Set in managed meta data Managed meta data navigation in SharePoint 2013 Managed metadata service in SharePoint 2013. Managed Navigation in SharePoint 2013. Managed Promoted Sites. meta data navigation Microsoft Flow New Features New-SPConfigurationDatabase The user does not exist or is not unique NintexWorkFlow Office 365 OneDrive OneNote overwrite existing document in sharepoint using javascript PDF Converter PDF Method in K2 Performance Point Service in SharePoint 2013 PerformancePoint Services Configurtion PerformancePoint Services Configurtion for SharePoint 2013 PerformancePoint Services in SharePoint Server 2013 Popularity trends in SharePoint 2013 Pages populate dropdown list dynamicallyusing jquery Power Power Automate Power Shell Power shell script to get SharePoint site size. PowerApps powershell read xml PowerShell Script PowerShell script to get list of users from SharePoint groups PowerShell Scripts in SharePoint 2013 Powershell to set the masterpage in SharePoint Promoted Links Promoted Sites psconfig.exe quick launch Rdlc reports Readonly Column in SharePoint Editview Realtime DotNet Interview Questions Recent Dotnet interview questions Recent SharePoint interview questions recover deleted OneNote page. OneNote content is missing Regional Settings in SharePoint 2013 Replace New Item text in SharePoint Rest API Schedule PowerShell Script Search in SharePoint 2013 Search navigation in SharePoint 2013 Secure store service SecureStore Services SecureStore Services configuration for SharePoint 2013 self-signed certificate on IIS Server Send email to members of SharePoint Group using PowerShell sharepint2010 sharepoin2010 SharePoint 2013 SharePoint 2010 SharePoint 2013 SharePoint 2013 Dashboard Designer SharePoint 2013 features SharePoint 2013 Interview Questions SharePoint 2013. SharePoint 2013.disable views from user to create SharePoint 2013.Power shell SharePoint 2013.SharePoint 2010 SharePoint 2016 SharePoint Administration SharePoint Alerts and Reminders SharePoint App Configuration SharePoint Apps SharePoint Bulk upload SharePoint Calculated field SharePoint Calendar View sharepoint interview questions SharePoint online interview questions SharePoint online training SharePoint Onprem vs Online SharePoint RealTime Online Training SharePoint2010 SharePoint2013 SharePoint2016 SharePointInterview SharePointOnline SharePointOnline;Restore deleted site;SharePoint 2013 show data in datagridview in C# Simple Insert update Delete Retrieve Clear in asp.net. Site Collection Operations in SharePoint 2013 Site Collection Read-Only in SharePoint 2013 site contents Sorting & Filtering SPO SPSite Site Collection Operation parameters in SharePoint 2013 Step by step to create rdlc report in .Net Store names in text files in C# Sub site Subsite Term store management. The server was unable to save the form at this time. please try again UI New look update created by using client side object model update field values in SharePoint using powershell update items in SharePoint list using client object model update modified by field using client side object model upload zip files in blog use IsNullOrEmpty in PowerShell VirtoSoftware VirtoSofware vitrosoftware WebParts what is Document Set in SharePoint 2010 What is Filter in SharePoint Dashboard what is Limited-access user permission lock down mode feature What is Modern Team site What is Target Audience in SharePoint Who Created Site Using PowerShell Workflow in SharePoint 2013 Workflow management platform in SharePoint 2013 Workflow manager for SharePoint 2013 XSL-Template.