Example #1
0
        private async void ButtonCountClick(object sender, EventArgs e)
        {
            if (OraSession != null)
            {
                FromCrets = new DateTime(2017, 5, 1);
                string FromCretsStr = FromCrets.ToString("dd'/'MM'/'yyyy HH:mm:ss");
                string query        = "Select trc.trcbus, count(t.transik) " +
                                      "From TRANSMAIN t join TRCBUS trc on trc.trcbusno = t.trcbusno " +
                                      "Where t.tracan=0 and t.chgts>=to_timestamp(:FromChgts,'DD/MM/YYYY HH24:MI:SS') " +
                                      "Group by trc.trcbus " +
                                      "Order by trc.trcbus";
                OracleCommand cmd = new OracleCommand(query, OraSession.Connection);
                listViewTransCode.Items.Clear();
                textBoxMessages.Text = "Calculating...";
                cmd.Parameters.Add(":FromChgts", OracleDbType.Varchar2).Value = FromCretsStr;
                DataTable dt = await OraSession.ExecuteQueryParallel(cmd);

                FillListView(dt);
                textBoxMessages.Text = "";
            }
            else
            {
                textBoxMessages.Text = "Please connect first";
            }
        }
Example #2
0
 private void ButtonConnectClick(object sender, EventArgs e)
 {
     if (OraSession == null)
     {
         Connection Connection = new Connection(host: "DK01SV7020", port: "1521", sid: "T7020230", schema: "TESTIMMD", password: "******");
         OraSession           = new OraSession(Connection.Data);
         textBoxMessages.Text = OraSession.Connect();
     }
 }