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 dsc { public partial class user : Form { static OleDbConnection con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\\Users\\internet\\Documents\\Visual Studio 2008\\Projects\\dsc\\dsc\\dscrec.accdb"); public user() { InitializeComponent(); } private void textBox3_TextChanged(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { OleDbCommand cmd = new OleDbCommand("select pin from personal where pin=" + textBox3.Text + "", con); con.Open(); OleDbDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { this.Close(); } con.Close(); } private void button2_Click(object sender, EventArgs e) { } private void user_Load(object sender, EventArgs e) { } } }
where pin='" + textBox3.Text + "'"
OleDbCommand cmd = new OleDbCommand("select pin from personal where pin=?", con); cmd.Parameters.AddWithValue("@pin",textBox3.Text);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)