15,741,688 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View Javascript questions
View C++ questions
View Python questions
View Java questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Judel Dobbs (Top 3 by date)
Judel Dobbs
12-Dec-21 10:52am
View
Ok a postfix expression gets characters such as 11*. Postfix gets the values before the perform the calculation on the operand. The Expression adds the characters one by one to a stack and performs the required operation if it's a value or an operand. The operation is pop or push. If a character is a number add it to the stack. IF ITS A operator pop and perform calculation until the stack is empty.
11* would return the value 1
Judel Dobbs
1-Dec-21 15:28pm
View
Thanks for your detailed response and reaching out to my problem. Ive added the code
Judel Dobbs
1-Dec-21 15:27pm
View
private void button1_Click(object sender, EventArgs e)
{
SqlConnection sqlco = new SqlConnection(@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\plumz\OneDrive\Documents\Programming Project 2021\PROGRAM\Database\Gym_Management_DB.mdf;Integrated Security=True;Connect Timeout=30");
SqlCommand cmd = new SqlCommand("SELECT * FROM log_data WHERE username = '" + username.Text.Trim() + "' AND password = '" + password.Text.Trim() + "' ", sqlco);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
string usertype = user_type.SelectedItem.ToString();
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)//state rows in table
{
if (dt.Rows[i]["usertype"].ToString() == usertype)
{
MessageBox.Show("You are logged in as " + dt.Rows[i][2]);
switch (user_type.SelectedIndex)
{
case 0:
{
customer customer1 = new customer();
customer1.Show();
this.Hide();
break;
}
case 1:
{
Staff staff1 = new Staff();
staff1.Show();
this.Hide();
break;
}
case 2:
{
Trainer trainer1 = new Trainer();
trainer1.Show();
this.Hide();
break;
}
default:
MessageBox.Show("wah gwan");
break;
} // end nested switch
} //end check for user type
}// end for loop
}// end row count
else
{
MessageBox.Show("The username or password is incorrect,Try Again");
}
} // end button LOG IN CLICK