Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 Vezba_13_2018
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void glumceToolStripMenuItem_Click(object sender, EventArgs e)
- {
- using (OleDbConnection connection = new OleDbConnection(Properties.Settings.Default.B3DVDkolekcijaConnectionString))
- {
- connection.Open();
- using (OleDbCommand command = new OleDbCommand("SELECT * FROM GLUMAC", connection))
- {
- using (OleDbDataReader reader = command.ExecuteReader())
- {
- textBox1.Clear();
- while(reader.Read())
- {
- textBox1.Text += reader.GetInt32(0);
- textBox1.Text += ". ";
- textBox1.Text += reader.GetString(1);
- textBox1.Text += ". ";
- textBox1.Text += reader.GetString(2);
- textBox1.Text += ". ";
- textBox1.Text += reader.GetDateTime(3);
- textBox1.Text += ". ";
- textBox1.Text += reader.GetString(4);
- textBox1.Text += ". ";
- textBox1.Text += "\r\n";
- }
- }
- }
- }
- }
- private void filmoveToolStripMenuItem_Click(object sender, EventArgs e)
- {
- using (OleDbConnection connection = new OleDbConnection(Properties.Settings.Default.B3DVDkolekcijaConnectionString))
- {
- connection.Open();
- using (OleDbCommand command = new OleDbCommand("SELECT Naziv, OpisRadnje FROM FILM", connection))
- {
- using (OleDbDataReader reader = command.ExecuteReader())
- {
- textBox1.Clear();
- DataTable dataTable = new DataTable();
- dataTable.Load(reader);
- foreach(DataRow dataRow in dataTable.Rows)
- {
- textBox1.Text += string.Format("{0} - {1}", dataRow[0], dataRow[1]);
- textBox1.Text += "\r\n\r\n";
- }
- dataGridView1.DataSource = dataTable;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement