using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;
namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data
Source='login.accdb'");
public Form2()
{
InitializeComponent();
}
private void label3_Click(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
Form1 frm1 = new Form1();
frm1.Show();
this.Hide();
}
private void button1_Click(object sender, EventArgs e)
{
string sqlSearch = "SELECT * FROM reg WHERE password='" + textBox1.Text + "'";
OleDbCommand cmd = new OleDbCommand(sqlSearch, con);
con.Open();
OleDbDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
if (textBox2.Text == textBox3.Text)
{
string sqlUpdate = "UPDATE reg SET WHERE password='" + textBox1.Text + "";
OleDbCommand cmdd = new OleDbCommand(sqlUpdate, con);
con.Open();
cmdd.ExecuteNonQuery();
con.Close();
MessageBox.Show("successfully updated");
}
else
{
MessageBox.Show("retype your new password correctly");
}
}
else
{
MessageBox.Show("No Record Found!");
}
con.Close();
}
}
}
pathum_1 0 Newbie Poster
Mike Askew 131 Veteran Poster Featured Poster
pathum_1 0 Newbie Poster
Ketsuekiame 860 Master Poster Featured Poster
Mike Askew 131 Veteran Poster Featured Poster
Ketsuekiame 860 Master Poster Featured Poster
Mike Askew commented: Not my code :D +7
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.