hi can anyone help me with this code that ive created for a login form, im having trouble with the username and password, ive highlighted the part that's giving me a problem.
Error Message: The name 'inputName' does not exist in the current context
: The name 'inputPass' does not exist in the current context
CODE:
namespace Jackson
{
public partial class login : Form
{
Client mainWindow = new Client();
public login()
{
InitializeComponent();
}
private void loginBindingNavigatorSaveItem_Click(object sender, EventArgs e)
{
this.Validate();
this.loginBindingSource.EndEdit();
this.loginTableAdapter.Update(this.dataSet.Login);
}
private void Form1_Load(object sender, EventArgs e)
{
// TODO: This line of code loads data into the 'dataSet.Login' table. You can move, or remove it, as needed.
this.loginTableAdapter.Fill(this.dataSet.Login);
}
private void loginBtn_Click(object sender, EventArgs e)
{
OleDbConnection conn = new OleDbConnection(@"provider = Microsoft.Jet.OLEDB.4.0;Data Source= C:\Documents and Settings\Developers ITD\My Documents\Visual Studio 2005\Projects\Jackson\Jackson\call.mdb");
OleDbCommand com = new OleDbCommand("SELECT username, password FROM Login");
OleDbDataReader reader;
bool permit = false;
try
{
conn.Open();
reader = com.ExecuteReader();
while (reader.Read())
{
if ([U]inputName[/U] == (reader["usernameTextBox"].ToString()) && [U]InputPass[/U] == reader["passwordTextBox"].ToString())
{
permit = true;
break;
}
}
conn.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
if (permit == true)
MessageBox.Show("Access granted");
else
MessageBox.Show("Access denied");
Client Main = new Client();
Main.Show();
this.Hide();