12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- 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.SqlClient;
- namespace EJ
- {
- public partial class backbb : Form
- {
-
- SqlConnection connection;
- SqlCommand command;
- SqlDataAdapter adapter;
- DataTable table;
- public backbb()
- {
- InitializeComponent();
- dataGridView1.AutoGenerateColumns = true;
- connection = new SqlConnection("SERVER=DESKTOP-JES5T51\\SQLEXPRESS;Database=EJ;Trusted_Connection=True;");
- command = new SqlCommand();
- command.Connection = connection;
- command.CommandType = CommandType.Text;
- adapter = new SqlDataAdapter(command);
- table = new DataTable();
- dataGridView1.DataSource = table;
- ShowTable("SELECT * FROM Расписание");
- }
-
- public void ShowTable(string text)
- {
- dataGridView1.Columns.Clear();
- dataGridView1.DataSource = null;
- command.CommandText = text;
- table.Clear();
- adapter.Fill(table);
- dataGridView1.DataSource = table;
- }
- private void Расписание_Load(object sender, EventArgs e)
- {
- // TODO: данная строка кода позволяет загрузить данные в таблицу "eJDataSet2.Расписание". При необходимости она может быть перемещена или удалена.
- this.расписаниеTableAdapter.Fill(this.eJDataSet2.Расписание);
- }
- private void button1_Click(object sender, EventArgs e)
- {
-
- }
- private void dataGridView1_Scroll(object sender, ScrollEventArgs e)
- {
-
- }
- private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
- {
-
- }
- private void button1_Click_1(object sender, EventArgs e)
- {
- Посещения Z = new Посещения();
- Z.Show();
- this.Hide();
- }
- }
- }
|