using System.Data.OleDb;
private void linkLabel1_LinkClicked(object sender,
LinkLabelLinkClickedEventArgs e)
{
Form2 frm2 = new Form2();
frm2.Show();
}
OleDbConnection baglan = new
OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=" +
Application.StartupPath + "\\personel.mdb");
OleDbCommand komut = new OleDbCommand();
private void button1_Click(object sender, EventArgs e)
{
komut.Connection = baglan;
komut.CommandType = CommandType.Text;
komut.CommandText = "Select Count(*) from personel where
k_ad='"
+ textBox1.Text + "' and sifre=" + textBox2.Text;
baglan.Open();
string say = Convert.ToString(komut.ExecuteScalar());
baglan.Close();
if (say == "1")
{
Form3 frm3 = new Form3();
frm3.Show();
this.Hide();
}
else
{
MessageBox.Show("Hatalı Giriş Yaptınız");
}
}
string resim;
OleDbConnection baglan = new
OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source="
+Application.StartupPath+"\\personel.mdb");
OleDbCommand komut = new OleDbCommand();
private void pictureBox1_Click(object sender, EventArgs e)
{
openFileDialog1.ShowDialog();
resim = openFileDialog1.FileName;
pictureBox1.Image = Image.FromFile(resim);
}
private void button1_Click(object sender, EventArgs e)
{
komut.Connection = baglan;
komut.CommandType = CommandType.Text;
komut.CommandText = "Insert Into
personel(ad,soyad,dtarihi,k_ad,sifre,resim) "
+ "values('" + textBox1.Text + "','" + textBox2.Text
+
"','" + dateTimePicker1.Value + "','" +
textBox3.Text +
"'," + textBox4.Text + ",'" + resim + "')";
baglan.Open();
komut.ExecuteNonQuery();
baglan.Close();
MessageBox.Show("Kayıt Tamamlandı");
}
OleDbConnection baglan = new
OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;Data Source=" +
Application.StartupPath + "\\personel.mdb");
OleDbCommand komut = new OleDbCommand();
private void Form3_Load(object sender, EventArgs e)
{
komut.Connection = baglan;
komut.CommandType = CommandType.Text;
komut.CommandText = "Select ad,soyad from personel";
baglan.Open();
OleDbDataReader oku;
oku = komut.ExecuteReader();
while (oku.Read())
{
comboBox1.Items.Add(oku[0].ToString() + " " +
oku[1].ToString());
}
baglan.Close();
}
Download

Uygulama_1