Berdaq nomidagi qoraqalpoq davlat universiteti



Yüklə 1,35 Mb.
səhifə8/8
tarix11.06.2023
ölçüsü1,35 Mb.
#128055
1   2   3   4   5   6   7   8
Документ Microsoft Word

Talabalar malumoti
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace Rajabov_Jamshid_kurs_ishi


{
public partial class Talabalar_malumoti : Form
{
OleDbConnection x = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\Rajabov Jamshid kurs ishi\Rajabov Jamshid kurs ishi\bin\Debug\talaba_malumoti____________xx.accdb");
public Talabalar_malumoti()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
if (!((textBox1.Text == "") || (textBox2.Text == "") ||
(textBox3.Text == "") || (textBox4.Text == "") || (textBox5.Text == "") ||
(comboBox1.Text == "") || (comboBox2.Text == "") || (comboBox3.Text == "")))
{
x.Open();
OleDbCommand y = x.CreateCommand();
y.CommandType = CommandType.Text;
y.CommandText = "insert into talaba_malumoti values('" + textBox1.Text +
"','" + textBox2.Text + "','" +
textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','"
+ comboBox1.Text + "','" + comboBox2.Text + "','" + comboBox3.Text + "')";
y.ExecuteNonQuery();
x.Close();
MessageBox.Show("Ma`lumotlar bazaga kiritildi");
textBox1.Text = "";
textBox2.Text = "";
textBox3.Text = "";
textBox4.Text = "";
textBox5.Text = "";
comboBox1.Text = "";
comboBox2.Text = "";
comboBox3.Text = "";

}
else MessageBox.Show("Ma`lumotlarni to`liq kiriting");


}

private void button4_Click(object sender, EventArgs e)


{
panel1.Visible = true;
}

private void button3_Click(object sender, EventArgs e)


{
try
{
x.Open();
OleDbCommand y = x.CreateCommand();
y.CommandType = CommandType.Text;
y.CommandText = "select * from talaba_malumoti";
y.ExecuteNonQuery();
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(y);
da.Fill(dt);
dataGridView1.DataSource = dt;
x.Close();
}
catch { }
}
private void button2_Click(object sender, EventArgs e)
{
try
{
x.Open();
OleDbCommand y = x.CreateCommand();
y.CommandType = CommandType.Text;
y.CommandText = "select * from talaba_malumoti where Familiya='" + textBox1.Text + "'";
y.ExecuteNonQuery();
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(y);
da.Fill(dt);
dataGridView1.DataSource = dt;
x.Close();
}
catch { }
}
private void button5_Click(object sender, EventArgs e)
{
try
{
x.Open();
OleDbCommand y = x.CreateCommand();
y.CommandType = CommandType.Text;
y.CommandText = "select * from talaba_malumoti where Fakulteti='" + comboBox1.Text + "'";
y.ExecuteNonQuery();
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(y);
da.Fill(dt);
dataGridView1.DataSource = dt;
x.Close();
}
catch { }
}

private void button7_Click(object sender, EventArgs e)


{
try
{
x.Open();
OleDbCommand y = x.CreateCommand();
y.CommandType = CommandType.Text;
y.CommandText = "select * from talaba_malumoti where Ism='" +textBox2.Text+ "'";
y.ExecuteNonQuery();
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(y);
da.Fill(dt);
dataGridView1.DataSource = dt;
x.Close();
}
catch { }
}

/* private void button6_Click(object sender, EventArgs e)


{
try
{
x.Open();
OleDbCommand y = x.CreateCommand();
y.CommandType = CommandType.Text;
y.CommandText = "select * from talaba_malumoti where Turar joy='" + comboBox3.Text + "'";
y.ExecuteNonQuery();
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(y);
da.Fill(dt);
dataGridView1.DataSource = dt;
x.Close();
}
catch { }
}*/

private void button9_Click(object sender, EventArgs e)


{
x.Open();
OleDbCommand y = x.CreateCommand();
y.CommandType = CommandType.Text;
y.CommandText = "delete from talaba_malumoti where Familiya='" + textBox1.Text + "'";
y.ExecuteNonQuery();
x.Close();
MessageBox.Show(" Malumot o`chirildi.");

}


private void button8_Click(object sender, EventArgs e)
{

}


private void button8_Click_1(object sender, EventArgs e)
{
panel1.Visible = false; ;
}
}
}
Yüklə 1,35 Mb.

Dostları ilə paylaş:
1   2   3   4   5   6   7   8




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©muhaz.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin