Shogunex
Shogunex
CC#
Created by Shogunex on 4/30/2024 in #help
How to hide Id column from the sqlite db (DataGrid)
No description
1 replies
CC#
Created by Shogunex on 4/25/2024 in #help
✅ Getting a single value in sql db
I am currently making a information system for our project in school and I am stuck at the login part wherein I need to get the role value of the username and password so they'll go to their respective panel once they've clicked logged in. I've been searching online and couldn't find an answer. Currently this is my code for my login button that i've followed in Youtube.
private void btnClick(object sender, RoutedEventArgs e)
{
/* String UN = tbGetter(tbUsernameLogin);
String PW = tbGetter(tbPasswordLogin);

panelMaster(validLogin(UN, PW));*/

var Username = tbUsernameLogin.Text;
var Password = passwordBox_password.Password;

using (UserDataContext context = new UserDataContext())
{
bool userFound = context.Users.Any(user => user.Name == Username && user.Password == Password);


if (userFound)
{


}
else
{
MessageBox.Show("User Not Found");
}

}



}
private void btnClick(object sender, RoutedEventArgs e)
{
/* String UN = tbGetter(tbUsernameLogin);
String PW = tbGetter(tbPasswordLogin);

panelMaster(validLogin(UN, PW));*/

var Username = tbUsernameLogin.Text;
var Password = passwordBox_password.Password;

using (UserDataContext context = new UserDataContext())
{
bool userFound = context.Users.Any(user => user.Name == Username && user.Password == Password);


if (userFound)
{


}
else
{
MessageBox.Show("User Not Found");
}

}



}
The database currently has ID, Name, Password, and Role. I need to get the Role of the current Name and Password that was used to login so i can put it in the panelMaster() so it'll go to their own panel.
40 replies