Exemplo n.º 1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (mysqlConn.connOpen() == true)
     {
         mysqlConn.insertFlight(dtDepartureDateTime.Text, dtArrivalDateTime.Text, tbDepartureCity.Text, tbArrivalCity.Text, tbPrice.Text);
         dataGridView1.DataSource = mysqlConn.qry("SELECT * FROM `tblFlight`").Tables[0];
     }
     mysqlConn.connClose();
 }
Exemplo n.º 2
0
 public FlightsForm()
 {
     InitializeComponent();
     mysqlConn = new FlightsDbConn();
     mysqlConn.connect();
     if (mysqlConn.connOpen() == true)
     {
         dataGridView1.DataSource = mysqlConn.qry("SELECT * FROM `tblFlight`").Tables[0];
     }
     mysqlConn.connClose();
 }