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 vjezba_baza
- {
- public partial class Form2 : Form
- {
- User odabraniUser;
- OleDbConnection con = new OleDbConnection("Provider=OraOLEDB.Oracle; OLEDB.NET=True; DATA SOURCE = veza1; PERSIST SECURITY INFO=True;USER ID = MHRANJ; PASSWORD = DfhI51aB461");
- public Form2()
- {
- InitializeComponent();
- }
- public Form2(User OdabraniUser)
- {
- InitializeComponent();
- odabraniUser = OdabraniUser;
- }
- private void Form2_Load(object sender, EventArgs e)
- {
- UserIdText.Text = odabraniUser.userID;
- con.Open();
- dataGridView1.Rows.Clear();
- string querry = "select * from PRODUCT where LAGER_VALUE>0";
- OleDbDataAdapter adapter = new OleDbDataAdapter(querry, con);
- DataTable dt = new DataTable();
- adapter.Fill(dt);
- OleDbCommand cmd = new OleDbCommand();
- cmd.ExecuteNonQuery();
- dataGridView1.DataSource = dt;
- con.Close();
- }
- private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
- {
- if (dataGridView1.Rows.Count > 0)
- NazivTxt.Text = dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement