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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:01:16+00:00 2026-06-15T17:01:16+00:00

Ok i got a form called Form2, this is the form where you should

  • 0

Ok i got a form called Form2, this is the form where you should see every thing and update everything out of a phpmyadmin database.

Then a second form that calls loginFrm, thats activated from Form2.

The only code i need or solution is if you login onto the loginform it should keep the status en can be called from the FORM2 if the login is TRUE or FALSE.

loginFrm.cs code:

    private void connectBtn_Click(object sender, EventArgs e)
    {
        MySqlConnection sconn = new MySqlConnection("User ID=root;Password=;Initial Catalog=cmstt;Data Source=localhost");

        sconn.Open();

        DataSet ds = new DataSet();

        MySqlDataAdapter da = new MySqlDataAdapter("select * from users where email ='" + UsrName.Text + "' and pass='" + PassWrd.Text + "'", sconn);

        da.Fill(ds);

        int count = ds.Tables[0].Rows.Count;

        if (count == 0)
        {

            MessageBox.Show("Invalid UserID/Password");

        }

        else
        {

            this.Visible = false;
            MessageBox.Show("gelukt");

        }

        sconn.Close(); 


    }

If you give me help would you want to be clear about where i have put which code?

Thanks

  • 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-15T17:01:17+00:00Added an answer on June 15, 2026 at 5:01 pm

    Well in your Form2 which brings up the loginFrm, you could prompt like this:

    if (loginFrm.ShowDialog() == Windows.Forms.DialogResult.OK)
    {
        //Only move on if logged in succeeded
        MessageBox.Show("gelukt");
        DoOtherStuff();
    }
    else
    {
        MessageBox.Show("Invalid UserID/Password");
    }
    

    In your login form:

    if (count == 0)
    {
        this.DialogResult = Windows.Forms.DialogResult.Cancel;
    }
    else
    {
        this.DialogResult = Windows.Forms.DialogResult.OK;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got a textbox on a form with a method being called from
I've got a form and I need to post data to the server every
This is the scenario. You've got a web form and you want to prompt
Got stuck and need some help, This should be relatively simple but it's been
I'm pretty new to C# and got this assignment. I have a class called
I got a form in Django but when I use {{ form.as_p }} it
I have got a form into which information is entered, and a drop down
I've got a form inside a table that has some Javascript validation. The table
I've got a form that has to be a repeater on a webpage. I
I've got a form which includes the option to upload an image. In my

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.