Hi how can i write a program to compare data entered and data stored? when we click ok. they will detect whether information store is the same.
Just an example login. but mine is asp.net i'm just using normal window application.
previously i use this is to store my password. but now i want to take the password store to compare with the one entered.
writeToB is under save();
private void writeToB()
{
vlAccessConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DBFileName);///
try///
{
vlAccessConnection.Open();
}
catch (OleDbException ee)
{
MessageBox.Show(ee.Message + ". StackTrace: " + ee.StackTrace.ToString());
}///
try
{
//UPDATE table SET newvalue WHERE criteria;
string cmdStr = "UPDATE AdminPassword SET CurrentPassword = " + password + " WHERE UserName = 'Admin'";
OleDbDataAdapter adapter = new OleDbDataAdapter();
OleDbCommand update = new OleDbCommand(cmdStr, vlAccessConnection);
adapter.UpdateCommand = update;
update.ExecuteNonQuery();
vlAccessConnection.Close();
}
catch (InvalidOperationException ex)
{
MessageBox.Show(string.Format("Failed to insert record into Database\n{0}",ex.Message));
}