NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

<<<<<<<<<<<<Form1>>>>>>>>>>>>>>>>>>>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb; //Veritabanı Bağlamak İçin//

namespace Bütünleme_Çalışma
{
public partial class Form1 : Form
{
OleDbConnection baglanti = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Araclar.accdb");
public Form1()
{
InitializeComponent();
}

private void button5_Click(object sender, EventArgs e)
{
Form2 ac = new Form2();
ac.ShowDialog();
}

private void Form1_Load(object sender, EventArgs e)
{
baglanti.Open();
OleDbCommand aksesuargetir = new OleDbCommand("select * from Aksesuar where AksesuarAdı",baglanti);
OleDbDataReader oku = aksesuargetir.ExecuteReader();
while (oku.Read())
{
comboBox1.Items.Add(oku["AksesuarAdı"].ToString());
}
baglanti.Close(); //Burda veritabanında bulunan aksesuar tablosundaki aksesuar adlarını combobox'a //
//yüklüyoruz..//
}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
baglanti.Open();

OleDbCommand aksesuarıdgetir = new OleDbCommand("select AksesuarID from Aksesuar where AksesuarAdı='" + comboBox1.SelectedItem.ToString() + "'", baglanti);
OleDbDataReader oku = aksesuarıdgetir.ExecuteReader();
int id = Convert.ToInt16(oku.Read());
OleDbCommand firmagetir = new OleDbCommand("select * from Firma where FirmaAksesuarNo=" + id, baglanti);
OleDbDataReader oku2 = firmagetir.ExecuteReader();
while (oku2.Read())
{
comboBox3.Items.Add(oku2["FirmaAdı"].ToString());
}

baglanti.Close();
//Combobox'ta seçilen aksesuar adına göre 3. combobox'a o aksesuara ait firmaları getiriyoruz//

}

private void button1_Click(object sender, EventArgs e)
{
baglanti.Open();
OleDbCommand aksesuaridgetir = new OleDbCommand("select * from Aksesuar where AksesuarAdı='" + comboBox1.SelectedItem.ToString() + "'",baglanti);
OleDbDataReader oku = aksesuaridgetir.ExecuteReader();
int aksesuarid = 0;
int fiyatid = 0;
if (oku.Read())
{
aksesuarid = Convert.ToInt16(oku["AksesuarID"].ToString());
fiyatid = Convert.ToInt16(oku["AksesuarFiyat"].ToString());
}
OleDbCommand firmagetir = new OleDbCommand("select * from Firma where FirmaAksesuarNo=" + aksesuarid, baglanti);
OleDbDataReader oku2 = firmagetir.ExecuteReader();
string firmaadi;
int stok = 0;
while (oku2.Read())
{
firmaadi = oku2["FirmaAdı"].ToString();
stok = Convert.ToInt16(oku2["FirmaStok"].ToString());
listBox1.Items.Add(comboBox1.SelectedItem.ToString() + " " + firmaadi + " " + fiyatid + " " + stok);
}
baglanti.Close();
//Seçilen Aksesuar ve Firmaya Göre Aksesuarın (Adını-Firmasını-Fiyatını ve Stoğunu) listbox' ekliyoruz.
}

private void button3_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
baglanti.Open();
OleDbCommand firmaadres = new OleDbCommand("select * from Firma where FirmaAdres='" + textBox1.Text + "'", baglanti);
OleDbDataReader oku = firmaadres.ExecuteReader();
while (oku.Read())
{
listBox1.Items.Add(oku["FirmaAdı"].ToString());

}
baglanti.Close();
//Textbox' yazılan adrese göre firmaları aratttırıp listbox' ekliyoruz..//
}

private void button4_Click(object sender, EventArgs e)
{
baglanti.Open();
OleDbCommand fiyatagöreara = new OleDbCommand("select * from Aksesuar where AksesuarFiyat >'" + textBox2.Text + "' and AksesuarFiyat<'" + textBox3.Text + "'", baglanti);
OleDbDataReader oku = fiyatagöreara.ExecuteReader();

while (oku.Read())
{
listBox1.Items.Add(oku["AksesuarAdı"].ToString());
}

baglanti.Close();
//textbox'a yazılan fiyat aralığında ki aksesuarları sıralıyor.//

}

private void button2_Click(object sender, EventArgs e)
{
baglanti.Open();
OleDbCommand firmagetir = new OleDbCommand("select AksesuarID from Aksesuar where AksesuarAdı='" + comboBox1.SelectedItem.ToString() + "'", baglanti);
OleDbDataReader oku = firmagetir.ExecuteReader();
int id = Convert.ToInt16(oku.Read());
OleDbCommand firmagetirme = new OleDbCommand("select * from Firma where FirmaAksesuarNo=" + id, baglanti);
OleDbDataReader oku2 = firmagetirme.ExecuteReader();
while (oku2.Read())
{
listBox1.Items.Add(oku2["FirmaAdı"].ToString() + " " + oku2["FirmaTel"].ToString() + " " + oku2["FirmaAdres"].ToString());
}

baglanti.Close();
//Seçilen Aksesuar'ın hangi Firmalarda olduğunu bulup listbox'a o firmalara ait bilgileri ekliyoruz//
}
}
}

<<<<<<<<<<<<Form2>>>>>>>>>>>>>>>>
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.OleDb;
namespace Bütünleme_Çalışma
{
public partial class Form2 : Form
{
OleDbConnection baglanti = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Araclar.accdb");
public Form2()
{
InitializeComponent();
}

private void button4_Click(object sender, EventArgs e)
{
baglanti.Open();
OleDbCommand aksesuarekle = new OleDbCommand("insert into Aksesuar (AksesuarAdı,AksesuarFiyat) values (@adı,@fiyat)", baglanti);
aksesuarekle.Parameters.AddWithValue("@adı", textBox1.Text);
aksesuarekle.Parameters.AddWithValue("@fiyat", textBox2.Text);
aksesuarekle.ExecuteNonQuery();
MessageBox.Show("Aksesuar Eklenmiştir..!!");
baglanti.Close();
//Textbox'lara yazılan bilgileri veritabanına ekliyoruzz..//
}

private void button2_Click(object sender, EventArgs e)
{
baglanti.Open();
OleDbCommand degistir = new OleDbCommand("update Aksesuar set AksesuarFiyat='" + textBox2.Text + "' where AksesuarAdı='" + textBox1.Text + "'", baglanti);
degistir.ExecuteNonQuery();
MessageBox.Show("Aksesuar İsmi Değiştirildi..!");
baglanti.Close();
//Textbox'a yazılan aksesuar adına göre o aksesuara ait fiyatı güncelliyoruz(update ediyoruz.)//
}

private void Form2_Load(object sender, EventArgs e)
{

}

private void button3_Click(object sender, EventArgs e)
{
baglanti.Open();
OleDbCommand sil = new OleDbCommand("delete from Aksesuar where AksesuarAdı='" + textBox1.Text + "'",baglanti);
sil.ExecuteNonQuery();
MessageBox.Show("Aksesuar Silinmiştir");
baglanti.Close();

//textbox' yazılan aksesuar adına göre aksesuar tablosundan o aksesuar'ı siliyoruz//
}
}
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.