IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası
  sohbet

 Kayıt ol  Topluluk
Yeni Konu aç Cevapla
 
LinkBack Seçenekler Stil
Alt 21 Temmuz 2013, 11:37   #1
Çevrimdışı
aSi
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
C# İle Veritabanı Projesi




C# dilinde yazılan bu programda uygulama klasöründe bulunan veritabanına (Microsoft Access) erişim sağlanmış ve bir proje geliştirilmeye çalışılmıştır. Yönetici şifresi "1" dir. Programda C# programlama dili üzerinden access veritabanı erişim, kayıt ekleme, kayıt arama, kayıt silme ve kayıt düzenleme gibi işlemler yapılmıştır.

Kod:   Kodu kopyalamak için üzerine çift tıklayın!
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.OleDb; namespace yazılım { public partial class Form1 : Form { public Form2 f2; //public Form3 f3; OleDbConnection conn = new OleDbConnection("provider = Microsoft.Jet.OleDb.4.0; Data Source= stok.mdb"); //Access baglantısı olusturur int column = 0; int row = 0; //int total = 0; //int row2 = 0; //int num3; //int num2; //int son; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { textBox1.Visible = false; // textBox2.Visible = false; groupBox3.Visible = false; } private void radioButton1_CheckedChanged(object sender, EventArgs e) { groupBox3.Visible = true; dataGridView1.Rows.Clear(); row = 0; conn.Open(); string sql; sql = "select * from personel2"; OleDbCommand cmd = new OleDbCommand(sql, conn); OleDbDataReader mrdr; mrdr = cmd.ExecuteReader(); while (mrdr.Read() == true) { dataGridView1.Rows.Add(); dataGridView1[column++, row].Value = (string)mrdr["adi"]; dataGridView1[column++, row].Value = (string)mrdr["soyadi"]; // dataGridView1[column++, row].Value = (mrdr["ceptel"]).ToString(); //dataGridView1[column++, row].Value = (mrdr["evtel"]).ToString(); //dataGridView1[column++, row].Value = (string)mrdr["email"]; // dataGridView1[column++, row].Value = (string)mrdr["adres"]; dataGridView1[column++, row].Value = (string)mrdr["cinsiyet"]; row++; column = 0; } mrdr.Close(); conn.Close(); } private void button1_Click(object sender, EventArgs e) { Application.Exit();//uygulamayı kapatır. } private void radioButton2_CheckedChanged(object sender, EventArgs e) { textBox1.Visible = true; //textBox2.Visible = false; groupBox3.Visible = false; textBox1.Focus(); } private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { try { int pass = int.Parse(textBox1.Text); if (pass == 1) { string date3 = (monthCalendar1.SelectionStart.ToShortDateString()); f2 = new Form2(conn, date3); f2.Show(); conn.Close(); } else { MessageBox.Show("Doğru Şifreyi Giriniz"); textBox1.Text = ""; } } catch (Exception en) { MessageBox.Show(en.Message); } } conn.Close(); } private void button2_Click(object sender, EventArgs e) { try { //veri tabanındaki verileri okuma komutu OleDbCommand veri2 = new OleDbCommand("SELECT * FROM product ORDER BY pid", conn); OleDbDataReader oku = null; conn.Open();//baglanti acar oku = veri2.ExecuteReader();//veri aktarma komutu calisir // listView2.Items.Clear();//listview deki verileri temizler while (oku.Read())//veri tabanindaki verileri listview e yazdiran dongu { ListViewItem urunItem = new ListViewItem(oku["pid"].ToString()); urunItem.SubItems.Add(oku["pname"].ToString()); urunItem.SubItems.Add(oku["pprice"].ToString()); urunItem.SubItems.Add(oku["psayi"].ToString()); // listView2.Items.Add(urunItem); } conn.Close();//baglanti kapatir } catch { MessageBox.Show("Veri Tabaniyla Baglanti Kurulamadi.\nProgramin bulundugu dizinde kayit.mdb\ndosyasinin bulundugundan emin olun\nve programi tekrar baslatin"); } } private void radioButton3_CheckedChanged_1(object sender, EventArgs e) { //textBox2.Visible = true; textBox1.Visible = false; groupBox3.Visible = false; //textBox2.Focus(); } private void textBox2_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) { try { // int pass = int.Parse(textBox2.Text); //if (pass == 1) { string date4 = (monthCalendar1.SelectionStart.ToShortDateString()); //f3 = new Form3(conn, date4); //f3.Show(); conn.Close(); } //else { MessageBox.Show("Doğru Şifreyi Giriniz"); // textBox2.Text = ""; } } catch (Exception en) { MessageBox.Show(en.Message); } } conn.Close(); } private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { } } }


__________________
Doğruları biliyorsan, yalanları dinlemek eğlencelidir.
 
Alıntı ile Cevapla

IRCForumlari.NET Reklamlar
sohbet odaları reklam ver Benimmekan Mobil Sohbet
Cevapla

Etiketler
yle


Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir)
 

Yetkileriniz
Konu Acma Yetkiniz Yok
Cevap Yazma Yetkiniz Yok
Eklenti Yükleme Yetkiniz Yok
Mesajınızı Değiştirme Yetkiniz Yok

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodu Kapalı
Trackbacks are Kapalı
Pingbacks are Açık
Refbacks are Açık


Benzer Konular
Konu Konuyu Başlatan Forum Cevaplar Son Mesaj
Php İle Veritabanı Flevour PHP 0 26 Eylül 2012 13:20
php veritabanı classı HolySpectre PHP 0 13 Mayıs 2011 20:55
ADO İle Veritabanı Cemalizim Visual Basic 0 19 Temmuz 2008 16:52
Ssh İle Veritabanı Yükleme Heidi GNU, Linux ve UNIX 0 11 Temmuz 2008 22:32