I have problem. The following is a method I call to have a users credentials checked at the start of my page. When I click the button that calls this method however, it gives me an error stating : "No value given for one or more required parameters"
public void doLogin()
{
string UserN = "";
string PassW = "";
try
{
// Create OleDbConnection for login purposes. The while loop sets the vars and the if statement checks it.
string readCommand = "SELECT * FROM Jobs WHERE Username='" + UsernameTextbox.Text + "'";
OleDbConnection loginConnection = new OleDbConnection();
loginConnection.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\JobNet\Database\jobs.mdb;Persist Security Info=False";
OleDbCommand loginCommand = new OleDbCommand(readCommand,loginConnection);
loginConnection.Open();
OleDbDataReader loginR = loginCommand.ExecuteReader();
while (loginR.Read())
{
UserN = loginR["Username"].ToString();
PassW = loginR["Password"].ToString();
if ((UsernameTextbox.Text == UserN) && (PasswordTextBox.Text == PassW))
{
Label3.Text = "Success!";
}
}
loginConnection.Close();
}
catch (OleDbException exc)
{
Label3.Text = "Error : " + exc.Message;
}
}
WHAT AM I MISSING???
![Confused :?](./images/smilies/icon_confused.gif)
![Confused :?](./images/smilies/icon_confused.gif)
I'm using VS.Net 2003 and .Net Framework version 1.1