Hastahane İşlemleri DataSetli Örnek C#.NET(C.NET)…


oLeDbDataAdapter Oluşturma (Resimli Anlatım)
======= Veritabanı Bağlama ========
Veritabanı Bağlamak için Öncelikle projemizin kayıtlı bulunduğu dosya içinde WindowsFormsApplication adındaki klasörün içindeki bin klasörüne girip oradanda Debug Adlı klasör içine girip MS accesste oluşturduğumuz veritabanı dosyasını oluşturuyoruz..Bu işlemi yaptıktan sonra projemizi açıp toolboxda Data altında bulunan kontrollere OledbAdapter,OledbConnection,Dataview ve DataGrid kontrollerini eklememiz gerekir.. Bunun için toolboxda Data üzerine sağ tuş Choose İtems a tıklarayarak Adı geçen kontrolleri gelen pencerede seçerek toolbox a ekleriz.. Ardından OledbAdapter Kontrolüne çift tıklayarak Veritabanını bağlama işlemine başlayacağız..OledbAdapter e tıkladıktan sonra gelen pencereden New Connection diyoruz.. Gelen pencerede Data Source karşısındaki Change Butonuna basarak gelen pencereden other Seçilip OK butona basarız..Bu İşlemi yaptıktan sonra OLE DB Provider ın Altında bulunan açılır liste kutusundan Microsoft Jet 4.0 OLE DB Provider Seçildikten sonra Data Links Butonuna tıklarız.1.Veritabanı adını seçiniz veya girin karşısında … Butonuna basarak daha önce oluşturduğumuz access veritabanı dosyasını seçeriz..Bu işlemi yaptıktan sonra Bağlantıyı sına Butonuna basarak Bağlantımızın düzgün olup olmadığını kontrol ederiz..Sınama başarılı oldu mesajı alındıktan sonra Tamam Butonuna basarız.. Ekranda kalan penceremizde Test Connection Butona basarak YineBağlantımızın doğru olup olmadığını kontrol ederiz.. Test connection succeeded mesajını aldıktan sonra OK butonuna basarız..Ekranda kalan pencereden NExt Diyerek devam ederiz.. Next butonuna bastıktan sonra Bir mesaj gelecektir bu mesaja evet diyerek geçeriz.Yine next butonuna basarak devam ederiz. Next dedikten sonra gelen pencerede Query Builder butonuna basarız..Gelen pencerede accesste oluşturduğumuz tablo(lar) görüntülenecektir..Burada Kullanacağımız tablo(lar) seçip add butonana basarız.. Add butonuna basıp tablomuzu ekledikten sonra close butonuna basarak pencereyi kapatırız.. Ekrandaki pencerede tablodaki tüm alanların gözükmesini istiyorsak All Columns seçeneğine tıklayarak Execute Query butununa basarak Oluşturduğumuz tablodaki verileri ve alanları görüntüleriz.. Bu işlemi yaptıktan sonra OK butonuna basarak Ekranda bulunan pencereden Next butonuna basarız .. Ardından Gelen pencereden Finish Butonuna basarız ve pencere kapanır..
Ardından toolboxda bulunan Data ya eklediğimiz kontrollerden Dataviewe çift tıklayarak Formumuzun altına ekleriz..Bu işlemden sonra formumuzun altında bulunan oledbAdapter Üzerine gelip sağ tuş Generate Dataset e tıklarız gelen pencerede OK butonuna basarız..Bu işlemi yaptıktan sonra formumuzun altına eklediğimiz dataview i seçip properties penceresinden Table Özelliğine tıklatıp Dataset11 altında bulunan tablomuzu seçeriz. bu işlemi yaptıktan sonra Yine toolboxda data içine ekledğimiz DataGrid kontrolünü formumuza ekliyoruz..Datagrid i ekledikten sonra datagrid i seçip properties penceresinde DataSource özelliğine tıklayıp Form1 List İnstances in Altında bulunan Dataviewi seçiyoruz.. Bu işlemide yaptıktan sonra Veritabanı bağlama işlemi başarı ile sona ermiştir…
Yukarıda anlatılan işlemlerin resimli anlatımı için link : https://www.gorselprogramlama.com/oledbadapter-olusturma-resimli-anlatim-cnetcnet
silme ve değiştir işlemlerinde sorun yaşıyorsanız yukarıdaki linki tıkladıktan sonra alt ksımdaki yorumlara bakınız.
[code=’Csharp’]
//FORM1 İçerisine yazılacak kodlar…
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
label1.Text = ” HASTA KAYIT PROGRAMI “;
timer1.Start();
timer1.Interval = 100;
}
private void timer1_Tick(object sender, EventArgs e)
{
label1.Text = label1.Text.Substring(1) + label1.Text[0].ToString();
}
private void hastaKaydıToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2 frm2 = new Form2();
frm2.Show();
}
private void laboratuvarİşlemleriToolStripMenuItem_Click(object sender, EventArgs e)
{
Form3 frm3 = new Form3();
frm3.Show();
}
private void radyolojiİşlemleriToolStripMenuItem_Click(object sender, EventArgs e)
{
Form4 frm4 = new Form4();
frm4.Show();
}
private void ücretİşlemleriToolStripMenuItem_Click(object sender, EventArgs e)
{
Form6 frm6 = new Form6();
frm6.Show();
}
private void yardımKonularıToolStripMenuItem_Click(object sender, EventArgs e)
{
Form8 frm8 = new Form8();
frm8.Show();
}
}
//FORM2 İçerisine Yazılacak Kodlar…
public partial class Form2 : Form
{
string[] hasta_sırasi = new string[50];
string[] ad = new string[50];
string[] soyad = new string[50];
string[] tc_kimlik = new string[50];
string[] doktor_ad = new string[50];
int a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0;
public Form2()
{
InitializeComponent();
}
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsDigit(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void Form2_Load(object sender, EventArgs e)
{
System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();
ToolTip1.SetToolTip(this.button3, “Hafızaya Al”);
ToolTip1.SetToolTip(this.button9, “Ekle”);
ToolTip1.SetToolTip(this.button4, “Listeyi Sil”);
ToolTip1.SetToolTip(this.button8, “Yazdır”);
ToolTip1.SetToolTip(this.button6, “Çıkış”);
ToolTip1.SetToolTip(this.button1, “Önceki Kayıt”);
ToolTip1.SetToolTip(this.button2, “Sonraki Kayıt”);
ToolTip1.SetToolTip(this.button5, “İlk Kayıt”);
ToolTip1.SetToolTip(this.button7, “Son Kayıt”);
ToolTip1.SetToolTip(this.button10, “Ara”);
ToolTip1.SetToolTip(this.button11, “Yeni Kayıt Ekle”);
ToolTip1.SetToolTip(this.button12, “Kaydet”);
ToolTip1.SetToolTip(this.button4, “Kaydı Sil”);
comboBox1.Items.Add(“Nurgül CEYLAN”);
comboBox1.Items.Add(“SONGÜL YILMAZ”);
comboBox1.Items.Add(“YEŞİM KILIÇ”);
comboBox1.Items.Add(“AYÇA KAHRAMAN”);
comboBox2.Items.Add(“Postacı”);
comboBox2.Items.Add(“Ayakkabıcı”);
comboBox2.Items.Add(“Polis”);
comboBox2.Items.Add(“Muhasebeci”);
comboBox2.Enabled = false;
oleDbDataAdapter1.Fill(dataSet11, “hasta_kayıt”);
}
private void textBox5_TextChanged(object sender, EventArgs e)
{
if(textBox5.Text.Length>10 & textBox5.Text.Length<12)
MessageBox.Show("T.C Kimlik Numarası 11 den Küçük veya Büyük Olamaz");
}
private void textBox5_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsDigit(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox7_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox9_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox15_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox17_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox23_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox11_TextChanged(object sender, EventArgs e)
{
}
private void textBox11_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsDigit(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox19_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsDigit(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox21_TextChanged(object sender, EventArgs e)
{
}
private void textBox21_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsDigit(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox34_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsDigit(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox28_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void button4_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
}
private void button6_Click(object sender, EventArgs e)
{
Close();
}
private void button8_Click(object sender, EventArgs e)
{
printDialog1.ShowDialog();
}
private void textBox7_TextChanged(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
hasta_sırasi[a1] = (textBox2.Text);
ad[a2] = (textBox7.Text);
soyad[a3] = (textBox9.Text);
tc_kimlik[a4] = (textBox5.Text);
doktor_ad[a5] = (comboBox1.Text);
a1++;
a2++;
a3++;
a4++;
a5++;
}
private void button9_Click(object sender, EventArgs e)
{
int b1, b2, b3, b4, b5;
for (b1 = 0; b1 < a1; b1++)
for (b2 = 0; b2 < a2; b2++)
for (b3 = 0; b3 < a3; b3++)
for (b4 = 0; b4 < a4; b4++)
for (b5 = 0; b5 < a5; b5++)
listBox1.Items.Add(hasta_sırasi[b1].PadRight(20,' ') + " " + ad[b2].PadRight(15, ' ') + " " + soyad[b3].PadRight(15, ' ') + " " +tc_kimlik[b4].PadRight(15, ' ') + " " +doktor_ad[b5] .PadRight(15, ' '));
}
private void radioButton3_CheckedChanged(object sender, EventArgs e)
{
if (radioButton3.Checked == true)
comboBox2.Enabled = true;
else
comboBox2.Enabled = false;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "hasta_kayıt"].Position -= 1;
}
private void button2_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "hasta_kayıt"].Position += 1;
}
private void button5_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "hasta_kayıt"].Position =0;
}
private void button7_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "hasta_kayıt"].Position = this.BindingContext[dataSet11, "hasta_kayıt"].Count - 1;
}
int kayit;
string ara;
private void button10_Click(object sender, EventArgs e)
{
ara = textBox13.Text;
dataView1.Sort = "TC Kimlik";
kayit = dataView1.Find(ara);
DataRowView hucre;
hucre = dataView1[kayit];
textBox5.Text = hucre["TC Kimlik"].ToString();
textBox7.Text = hucre["Adı"].ToString();
textBox9.Text = hucre["Soyadı"].ToString();
textBox11.Text = hucre["Yaşı"].ToString();
textBox15.Text = hucre["Anne Adı"].ToString();
textBox17.Text = hucre["Baba Adı"].ToString();
textBox23.Text = hucre["Adres"].ToString();
}
private void button11_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "hasta_kayıt"].AddNew();
}
private void button12_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "hasta_kayıt"].EndCurrentEdit();
oleDbDataAdapter1.Update(dataSet11);
}
private void button13_Click(object sender, EventArgs e)
{
DialogResult cevap;
cevap = MessageBox.Show("Kayıdı Silmek İstediğinizden Eminmisiniz...","Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (cevap == DialogResult.Yes)
{
int kayit_no;
kayit_no = this.BindingContext[dataSet11, "hasta_kayıt"].Position;
this.BindingContext[dataSet11, "hasta_kayıt"].RemoveAt(kayit_no);
this.BindingContext[dataSet11, "hasta_kayıt"].Position -= 1;
this.BindingContext[dataSet11, "hasta_kayıt"].EndCurrentEdit();
oleDbDataAdapter1.Update(dataSet11);
}
}
//FORM3 İçerisine Yazılacak Kodlar...
public partial class Form3 : Form
{
string[] ad = new string[50];
string[] soyad = new string[50];
string[] yaptırdığı_test = new string[50];
string[] kan_grubu = new string[50];
int a1 = 0, a2 = 0, a3 = 0, a4 = 0;
public Form3()
{
InitializeComponent();
}
private void button6_Click(object sender, EventArgs e)
{
Close();
}
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void Form3_Load(object sender, EventArgs e)
{
System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();
ToolTip1.SetToolTip(this.button1, "Hafızaya Al");
ToolTip1.SetToolTip(this.button4, "Ekle");
ToolTip1.SetToolTip(this.button2, "Listeyi Sil");
ToolTip1.SetToolTip(this.button3, "Yazdır");
ToolTip1.SetToolTip(this.button6, "Çıkış");
ToolTip1.SetToolTip(this.button5, "Önceki Kayıt");
ToolTip1.SetToolTip(this.button7, "Sonraki Kayıt");
ToolTip1.SetToolTip(this.button8, "İlk Kayıt");
ToolTip1.SetToolTip(this.button9, "Son Kayıt");
ToolTip1.SetToolTip(this.button10, "Yeni Kayıt Ekle");
ToolTip1.SetToolTip(this.button11, "Kaydet");
ToolTip1.SetToolTip(this.button12, "Sil");
comboBox1.Items.Add("Kan Tahlili");
comboBox1.Items.Add( "İdrar Tahlili");
comboBox1.Items.Add( " Kan Ölçümü");
comboBox1.Items.Add( "Kan Sayımı" );
comboBox1.Items.Add("Hemogram Ölçümü");
comboBox2.Items.Add("A(rh)+");
comboBox2.Items.Add("B(rh)+");
comboBox2.Items.Add("0 rh)+");
comboBox2.Items.Add("0(rh)-");
comboBox2.Items.Add("AB(rh)+");
oleDbDataAdapter1.Fill(dataSet11, "Lab_İşlem");
}
private void button2_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
}
private void button4_Click(object sender, EventArgs e)
{
int b1, b2, b3, b4;
for (b1 = 0; b1 < a1; b1++)
for (b2 = 0; b2 < a2; b2++)
for (b3 = 0; b3 < a3; b3++)
for (b4 = 0; b4 < a4; b4++)
listBox1.Items.Add(ad[b1].PadRight(20, ' ') + " " + soyad [b2].PadRight(15, ' ') + " " + yaptırdığı_test[b3].PadRight(15, ' ') + " " + kan_grubu[b4].PadRight(40, ' '));
}
private void button1_Click(object sender, EventArgs e)
{
ad[a1] = (textBox2.Text);
soyad[a2] = (textBox4.Text);
yaptırdığı_test [a3] =(comboBox1.Text);
kan_grubu [a4]=(comboBox2.Text);
a1++;
a2++;
a3++;
a4++;
}
private void button3_Click(object sender, EventArgs e)
{
printDialog1.ShowDialog();
}
private void button5_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Lab_İşlem"].Position -= 1;
}
private void button7_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Lab_İşlem"].Position += 1;
}
private void button8_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Lab_İşlem"].Position = 0;
}
private void button9_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Lab_İşlem"].Position = this.BindingContext[dataSet11, "Lab_İşlem"].Count - 1;
}
private void button10_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Lab_İşlem"].AddNew();
}
private void button11_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Lab_İşlem"].EndCurrentEdit();
oleDbDataAdapter1.Update(dataSet11);
}
private void button12_Click(object sender, EventArgs e)
{
DialogResult cevap;
cevap = MessageBox.Show("Kayıdı Silmek İstediğinizden Eminmisiniz...", "Uyarı", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (cevap == DialogResult.Yes)
{
int kayit_no;
kayit_no = this.BindingContext[dataSet11, "Lab_İşlem"].Position;
this.BindingContext[dataSet11, "Lab_İşlem"].RemoveAt(kayit_no);
this.BindingContext[dataSet11, "Lab_İşlem"].Position -= 1;
this.BindingContext[dataSet11, "Lab_İşlem"].EndCurrentEdit();
oleDbDataAdapter1.Update(dataSet11);
}
}
}
//FORM4 İçerisine Yazılacak Kodlar
public partial class Form4 : Form
{
public Form4()
{
InitializeComponent();
}
private void textBox7_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
Form5 frm5 = new Form5();
frm5.Show();
this.Hide();
}
private void Form4_Load(object sender, EventArgs e)
{
System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();
ToolTip1.SetToolTip(this.button1, "Düzenle");
ToolTip1.SetToolTip(this.button2, "Yazdır");
ToolTip1.SetToolTip(this.button3, "Çıkış");
ToolTip1.SetToolTip(this.button4, "Önceki Kayıt");
ToolTip1.SetToolTip(this.button5, "Sonraki Kayıt");
ToolTip1.SetToolTip(this.button6, "İlk Kayıt");
ToolTip1.SetToolTip(this.button7, "Son Kayıt");
ToolTip1.SetToolTip(this.button8, "Ara");
comboBox1.Items.Add("EMR");
comboBox1.Items.Add("Röntgen");
comboBox1.Items.Add("Ultrason");
comboBox1.Items.Add("Film");
oleDbDataAdapter1.Fill(dataSet11, "Rad_İşlem");
}
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void button2_Click(object sender, EventArgs e)
{
printDialog1.ShowDialog();
}
private void textBox8_TextChanged(object sender, EventArgs e)
{
}
private void button4_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Rad_İşlem"].Position -= 1;
}
private void button5_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Rad_İşlem"].Position += 1;
}
private void button6_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Rad_İşlem"].Position = 0;
}
private void button7_Click_1(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Rad_İşlem"].Position = this.BindingContext[dataSet11, "Rad_İşlem"].Count - 1;
}
int kayit;
string ara;
private void button8_Click(object sender, EventArgs e)
{
ara = textBox9.Text;
dataView1.Sort = "Adı";
kayit = dataView1.Find(ara);
DataRowView hucre;
hucre = dataView1[kayit];
textBox2.Text = hucre["Adı"].ToString();
textBox4.Text = hucre["Soyadı"].ToString();
textBox8.Text = hucre["Sonuç"].ToString();
}
}
//FORM5 İçerisine Yazılacak Kodlar...
public partial class Form5 : Form
{
public Form5()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Close();
}
private void Form5_Load(object sender, EventArgs e)
{
System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();
ToolTip1.SetToolTip(this.button2, "Kaydet");
ToolTip1.SetToolTip(this.button1, "Çıkış");
comboBox1.Items.Add("EMR");
comboBox1.Items.Add("Röntgen");
comboBox1.Items.Add("Ultrason");
comboBox1.Items.Add("Film");
}
private void textBox7_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void button2_Click(object sender, EventArgs e)
{
Form4 frm4 = new Form4();
frm4.textBox2.Text = textBox7.Text;
frm4.textBox4.Text = textBox8.Text;
frm4.textBox8.Text = textBox6.Text;
frm4.comboBox1.Text = comboBox1.Text;
frm4.dateTimePicker1.Text = dateTimePicker1.Text;
frm4.Show();
this.Hide();
}
}
//FORM6 İçerisine Yazılacak Kodlar...
public partial class Form6 : Form
{
public Form6()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Form7 frm7 = new Form7();
frm7.Show();
this.Hide();
}
private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox4_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox9_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsDigit(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void button3_Click(object sender, EventArgs e)
{
Close();
}
private void Form6_Load(object sender, EventArgs e)
{
System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();
ToolTip1.SetToolTip(this.button1, "Düzenle");
ToolTip1.SetToolTip(this.button2, "Yazdır");
ToolTip1.SetToolTip(this.button3, "Çıkış");
ToolTip1.SetToolTip(this.button4, "Önceki Kayıt");
ToolTip1.SetToolTip(this.button5, "Sonraki Kayıt");
ToolTip1.SetToolTip(this.button6, "İlk Kayıt");
ToolTip1.SetToolTip(this.button7, "Son Kayıt");
ToolTip1.SetToolTip(this.button8, "Ara");
comboBox1.Items.Add("Ameliyat");
comboBox1.Items.Add("Tansiyon Ölçümü");
comboBox1.Items.Add("Muayene");
comboBox1.Items.Add("Acil Müşahade");
comboBox2.Items.Add("1 gün");
comboBox2.Items.Add("2 gün");
comboBox2.Items.Add("5 gün");
comboBox2.Items.Add("1 hafta");
comboBox3.Items.Add("Nakit");
comboBox3.Items.Add("Kredi Kartı");
comboBox3.Items.Add("Havale");
comboBox2.Enabled = false;
oleDbDataAdapter1.Fill(dataSet11, "Üc_İşlem");
}
private void button2_Click(object sender, EventArgs e)
{
printDialog1.ShowDialog();
}
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
if (radioButton1.Checked == true)
comboBox2.Enabled = true;
else
comboBox2.Enabled =false;
}
private void button4_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Üc_İşlem"].Position -= 1;
}
private void button5_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Üc_İşlem"].Position += 1;
}
private void button6_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Üc_İşlem"].Position =0;
}
private void button7_Click(object sender, EventArgs e)
{
this.BindingContext[dataSet11, "Üc_İşlem"].Position = this.BindingContext[dataSet11, "Üc_İşlem"].Count - 1;
}
int kayit;
string ara;
private void button8_Click(object sender, EventArgs e)
{
ara = textBox13.Text;
dataView1.Sort = "Ad";
kayit = dataView1.Find(ara);
DataRowView hucre;
hucre = dataView1[kayit];
textBox2.Text = hucre["Ad"].ToString();
textBox4.Text = hucre["Soyad"].ToString();
textBox9.Text = hucre["Borç"].ToString();
}
}
//FORM7 İçerisine Yazılacak Kodlar...
public partial class Form7 : Form
{
public Form7()
{
InitializeComponent();
}
private void Form7_Load(object sender, EventArgs e)
{
System.Windows.Forms.ToolTip ToolTip1 = new System.Windows.Forms.ToolTip();
ToolTip1.SetToolTip(this.button1, "Kaydet");
ToolTip1.SetToolTip(this.button2, "Çıkış");
comboBox1.Items.Add("Ameliyat");
comboBox1.Items.Add("Tansiyon Ölçümü");
comboBox1.Items.Add("Muayene");
comboBox1.Items.Add("Acil Müşahade");
comboBox2.Items.Add("Nakit");
comboBox2.Items.Add("Kredi Kartı");
comboBox2.Items.Add("Havale");
}
private void textBox5_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsDigit(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void button1_Click(object sender, EventArgs e)
{
Form6 frm6 = new Form6();
frm6.textBox9.Text = textBox5.Text;
frm6.textBox2.Text = textBox8.Text;
frm6.textBox4.Text = textBox10.Text;
frm6.comboBox1.Text = comboBox1.Text;
frm6.comboBox3.Text = comboBox2.Text;
frm6.dateTimePicker1.Text = dateTimePicker1.Text;
frm6.dateTimePicker2.Text = dateTimePicker2.Text;
frm6.Show();
this.Hide();
}
private void textBox8_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
private void textBox10_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsLetter(e.KeyChar) == false && (e.KeyChar) != (char)08)
e.Handled = true;
}
}[/code]
hocam program açılmıyor ne yapmam lazım girmiyor.
Microsoft.Jet.OLEDB.4.0′ sağlayıcısı yerel makine kayıtlı değil. bu hatayı alıyorum
mehmet :
bilgisayarında access 2003 yüklü olmadığı için o hatayı veriyor.
Mehmet, makinen 64BIT o yüzden çalışmaz kardeşim..
Bende açılmıyor. 2010 ve 2012 Studio denedim – 64bit sistem. uygulama açıldığında Microsoft.Jet.OLEDB.4.0 hatasını 2012 studio veriyor ve duruyor program. Office 2013 yuklu access var içerisinde bunu calıstırmak ıcın ne yapmam gerekli?
Özcan :
Eğer 64 bit işletim sitemi kullanıyorsan .Geliştirmekte olduğunuz projenin üstüne sağ tuşla Properties -> Build sekmesine ->geçin.
Platform Target -> x86′yı seç.