How to execute multiple select queries with C# on Oracle? I have some queries like
select id from table a
select id from table b
etc.
I do not use ;
because when I execute a single query it seems like I am not allowed to use a ;
at the end of a query.
I execute it with:
{
string sqlQuery = System.IO.File.ReadAllText(Settings.applicatiePad + Form_Main.QueryMap + "\\" + queryFile); //load the textfile with query's
cmd.Connection = OraConnection.conn;
cmd.CommandText = sqlQuery;
cmd.CommandType = CommandType.Text;
OracleDataAdapter da = new OracleDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
BindingSource bs;
bs = new BindingSource();
bs.DataSource = ds.Tables[0].DefaultView;
bindingNavigator1.BindingSource = bs;
dataGridView1.DataSource = bs;
}
I want to start with simple select query's but my goal is to have text files with different queries like create, drop en PL/SQL blocks.