Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to execute batch file?
    text
    copied!<p>I've just written my first C# code ever! I followed this example in creating a data pull from <a href="http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/GettingStartedNETVersion/GettingStartedNETVersion.htm" rel="nofollow noreferrer">Oracle</a>:</p> <p>Here is my current code:</p> <pre><code>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 Oracle.DataAccess.Client; // ODP.NET Oracle managed provider using Oracle.DataAccess.Types; namespace OraTrigger { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { string oradb = "Data Source=server;User Id=user;Password=pass;"; OracleConnection conn = new OracleConnection(oradb); // C# conn.Open(); OracleCommand cmd = new OracleCommand(); cmd.Connection = conn; cmd.CommandText = "SELECT cast(count(D_DTM) AS varchar(20)) as trig FROM DMSN.DS3R_FH_1XRTT_BTS_LVL_KPI"; cmd.CommandType = CommandType.Text; OracleDataReader dr = cmd.ExecuteReader(); dr.Read(); label1.Text = dr.GetString(0); conn.Dispose(); } } } </code></pre> <p>How can I execute a batch file if the count is > 0? I tried to follow <a href="https://stackoverflow.com/questions/5519328/executing-batch-file-in-c-sharp">this</a>. But a stupid question is, where does the location of the bat file go?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload