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 8725251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:00:00+00:00 2026-06-13T08:00:00+00:00

any help would be great thank you. not sure why its all ways returning

  • 0

any help would be great thank you. not sure why its all ways returning a null
I’m not sure if its even connecting to the database.

my web config file

<configuration>
  <connectionStrings>
    <add name="accessConnectionString" providerName="Microsoft.Jet.OLEDB.4.0" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\***\Desktop\pratice\AccessTest\App_Data\TheList.mdb;Persist Security Info=True"/>
  </connectionStrings>
  <system.web>
    <compilation debug="true" targetFramework="4.0"/>
  </system.web>
</configuration>

middle tier code to check if user is in the database if they are return something if not return null

OleDbConnection sconn = new OleDbConnection();
    OleDbCommand scmd = new OleDbCommand();
    public DBMiddleTier()
    {
        try
        {
            // set up the connection strings        
            sconn.ConnectionString = ConfigurationManager.ConnectionStrings["accessConnectionString"].ToString();
        }
        catch(Exception ex)
        {
            throw ex;
        }
    }//end of constructor
    //class to check membership
    public object checkMembership(string logid, string password)
    {
        try
        {
            sconn.Open();
            //set propertiers of the command
            scmd.Connection = sconn;
            scmd.CommandType = CommandType.Text;
            scmd.CommandText = "select * from SubDealers where LoginID = @InputUsername and Password = @InputPassword";
            scmd.Parameters.Clear();
            OleDbParameter checkUsername = scmd.Parameters.Add("@InputUsername", OleDbType.VarChar, 50);
            checkUsername.Value = logid;
            OleDbParameter checkPassword = scmd.Parameters.Add("@InputPassword", OleDbType.VarChar, 50);
            checkPassword.Value = password;
            object result = scmd.ExecuteScalar();
            return result;
        }
        catch (OleDbException sqx)
        {
            throw sqx;
        }
        finally
        {
            sconn.Close();
        }
    }//end of method

my code behind page

try
        {
            object result = dm.checkMembership(txtLoginID.Text, txtPassword.Text);
            if (result != null)
            {
                Response.Redirect("https://www.google.com/");
            }
            else
            {
                txtLoginID.Text = "";
                txtPassword.Text = "";
                Page.ClientScript.RegisterStartupScript(this.GetType(), "notAmember", "alert('Sorry wrong id or password');", true);
            }
        }
        catch (Exception ex)
        {
            Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + ex.Message + "');", true);
        }
  • 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-13T08:00:01+00:00Added an answer on June 13, 2026 at 8:00 am

    have you tried this?

    select * from [SubDealers] where [LoginID] = @InputUsername and [Password] = @InputPassword"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Any help with this problem would be fantastic. I appreciate all contributions! Let us
I have a assignment due so any help would help a lot thank you!
Any help would be appreciated, I'm trying to convert the code below to C#,
Any help would be appreciated. I am looking for a way to programatically notified
I am stuck here, any help would be appreciated. I have a listbox of
I am new to jQuery. Any help would be appreciated I have two radio
am trying to squeeze some performance out of this query, any help would be
I'm getting an EXC_BAD_ACCESS but just can't work out why, any help would be
Any help here would be greatly appreciated. I have this table hospital Nurse |
I am relatively new to db design, so any help here would be appreciated.

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.