Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8398907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:09:52+00:00 2026-06-09T21:09:52+00:00

This method takes an input parameter (email address). If it exists in the table

  • 0

This method takes an input parameter (email address). If it exists in the table then it returns the value (email), if it doesn’t then it shouldn’t be returning any value but this method keeps on returning the same value (parameter) all the time.

Am I missing something?

private static string findEmailSubscription(string emailAddress)
    {
        try
        {
            //Fetch email Address
            using (DataAccess data = new DataAccess("Email"))
            {
                DynamicEntity[] emails = data.Adapter.Execute(
                    "SELECT EmailAddress FROM table " +
                    "WHERE EmailAddress=@EmailAddress; ",
                    ExecuteCommandType.Text,
                    new Object[,] {
                    {"EmailAddress", emailAddress ?? (object)DBNull.Value}
                });
            }

            return emailAddress;
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:09:53+00:00Added an answer on June 9, 2026 at 9:09 pm

    Look at your code:

    return emailAddress;
    

    That’s unconditional. You’re not using your emails variable at all. How did you expect this to work? (Not that this can be your complete code anyway, given that you have a try block with no catch or finally…)

    Note that a method with a return type can’t “return no value”. It could never return (not good), throw an exception, or return a value. That’s all it can do. It could return a null reference… is that what you want it to do?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a method which takes a String parameter and then returns
In this case, the Visual Studio designer generates a method which takes the parameter
I have a form: <form name=emailform id=emailform onsubmit=emailSubmit() method=post><div> <input type=text id=email name=email value=>
If a method takes a class/struct as an input parameter, what is the best
This is for a mathematical method that takes in 3 doubles as input (a,
For example, this method from NSCalendar takes a bitmask: - (NSDate *)dateByAddingComponents:(NSDateComponents *)comps toDate:(NSDate
I'm wondering how to go about testing this. I have a method that takes
<FORM NAME=form1 METHOD=POST action=some.jsp> <INPUT TYPE=text NAME=first VALUE=First> <INPUT TYPE=text NAME=second VALUE=Second> </FORM> When
I have implemented a web service in PHP. This service takes name/value pairs as
I have an interface specifying method that takes a generic type as input which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.