NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

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 quiztekrarhh
{
public partial class Form1 : Form
{
OleDbConnection baglanti = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=quizdatabase.accdb");
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
baglanti.Open();
OleDbCommand aksesuaridalmakodu = new OleDbCommand("select * from aksesuartbl where Adi='" + comboBox1.SelectedItem.ToString() + "'", baglanti);
OleDbDataReader aksesuaridoku = aksesuaridalmakodu.ExecuteReader();
int aksesuarid = 0;
int fiyatid = 0;
if (aksesuaridoku.Read())
{
aksesuarid = Convert.ToInt16(aksesuaridoku["Aksesuar_ID"].ToString());
fiyatid = Convert.ToInt16(aksesuaridoku["Fiyat"].ToString());

}

OleDbCommand firmabilgilerikodu = new OleDbCommand("select * from firmalartbl where Aksesuar_ID=" + aksesuarid, baglanti);
OleDbDataReader bilgigetir = firmabilgilerikodu.ExecuteReader();
string firmaadi = "";
int stok = 0;
while (bilgigetir.Read())
{
firmaadi = bilgigetir["Adi"].ToString();
stok = Convert.ToInt16(bilgigetir["Stok_ID"].ToString());
listBox1.Items.Add(comboBox1.SelectedItem.ToString() + " " + firmaadi + " " + fiyatid + " " + stok);
}

baglanti.Close();
}

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

OleDbCommand aksesuargetir = new OleDbCommand("SELECT aksesuartbl.Adi FROM aksesuartbl", baglanti);
OleDbDataReader getir = aksesuargetir.ExecuteReader();
while (getir.Read())
{
comboBox1.Items.Add(getir["Adi"].ToString());
}
baglanti.Close();
}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
baglanti.Open();
/* SEÇİLEN AKSESUARIN ID'SİNİ ALMAK İÇİN YAZDIĞIMIZ KOD*/
OleDbCommand aksesuaridgetirkomutu = new OleDbCommand("select Aksesuar_ID from aksesuartbl where Adi='" + comboBox1.SelectedItem.ToString()+"'", baglanti);
OleDbDataReader oku = aksesuaridgetirkomutu.ExecuteReader();
int id = Convert.ToInt16(oku.Read());
/* O AKSESUAR IDSİNE SAHİP FİRMALARIN ADLARINI ÇEKECEĞİZ.*/
OleDbCommand firmalarigetirmekomutu = new OleDbCommand("select * from firmalartbl where Aksesuar_ID="+id, baglanti);
OleDbDataReader oku2 = firmalarigetirmekomutu.ExecuteReader();
while (oku2.Read())
{
comboBox3.Items.Add(oku2["Adi"].ToString());
}
baglanti.Close();
}

private void button3_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
baglanti.Open();
OleDbCommand getir = new OleDbCommand("select * from firmalartbl where Adresi='" + textBox1.Text + "'", baglanti);
OleDbDataReader oku = getir.ExecuteReader();
while (oku.Read())
{
listBox1.Items.Add(oku["Adi"].ToString());
}
baglanti.Close();
}

private void button4_Click(object sender, EventArgs e)
{
baglanti.Open();
OleDbCommand getir = new OleDbCommand("select * from aksesuartbl where Fiyat>'" + textBox2.Text + "' and Fiyat<'" + textBox3.Text+"'", baglanti);
OleDbDataReader oku = getir.ExecuteReader();
while (oku.Read())
{
listBox1.Items.Add(oku["Adi"].ToString() +" "+ oku["Fiyat"].ToString());
}
baglanti.Close();
}

private void button2_Click(object sender, EventArgs e)
{
baglanti.Open();
OleDbCommand aksesuaridgetirkomutu = new OleDbCommand("select Aksesuar_ID from aksesuartbl where Adi='" + comboBox1.SelectedItem.ToString() + "'", baglanti);
OleDbDataReader oku = aksesuaridgetirkomutu.ExecuteReader();
int id = Convert.ToInt16(oku.Read());

OleDbCommand firmabilgilerigetirmekodu = new OleDbCommand("select * from firmalartbl where Aksesuar_ID=" + id, baglanti);
OleDbDataReader getir = firmabilgilerigetirmekodu.ExecuteReader();
while (getir.Read())
{
listBox1.Items.Add(getir["Adi"].ToString() + " " + getir["Telefon_Numarasi"].ToString() + " " + getir["Adresi"].ToString());
}
baglanti.Close();
}

private void button5_Click(object sender, EventArgs e)
{
Form2 ikinciform = new Form2();
ikinciform.ShowDialog();
}
}
}
------------ FORM 2 ------------

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 quiztekrarhh
{
public partial class Form2 : Form
{
OleDbConnection baglanti = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=quizdatabase.accdb");
public Form2()
{
InitializeComponent();
}

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

OleDbCommand aksesuargetir = new OleDbCommand("SELECT * FROM aksesuartbl", baglanti);
OleDbDataReader getir = aksesuargetir.ExecuteReader();
while (getir.Read())
{
comboBox1.Items.Add(getir["Adi"].ToString());
comboBox2.Items.Add(getir["Adi"].ToString());
}
comboBox1.SelectedIndex = comboBox2.SelectedIndex = 0;
baglanti.Close();
}

private void button5_Click(object sender, EventArgs e)
{
baglanti.Open();
OleDbCommand silmekomutu = new OleDbCommand("delete from aksesuartbl where Adi='" + comboBox1.SelectedItem.ToString() + "'", baglanti);
silmekomutu.ExecuteNonQuery();
baglanti.Close();
MessageBox.Show("VERI SİLİNDİ!");
}

private void button1_Click(object sender, EventArgs e)
{
baglanti.Open();
OleDbCommand eklemekomutu = new OleDbCommand("insert into aksesuartbl (Adi) values(@adi)", baglanti);
eklemekomutu.Parameters.AddWithValue("@adi", textBox1.Text);
eklemekomutu.ExecuteNonQuery();
MessageBox.Show("VERI EKLENDI!");
baglanti.Close();
}
}
}


     
 
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.