I have created a query to oracle db
Dictionary<decimal, decimal> Dict = new Dictionary<decimal, decimal>();
string strSelectIdWork = "SELECT COLUMN FROM my_tb WHERE ROW='" + Row + "'";
dataAdapter.Fill(ds, "my_tb");
foreach (DataRow row in ds.Tables["my_tb"].Rows)
{
foreach (DataColumn column in ds.Tables["my_tb"].Columns)
{
Dict.Add(Dict.Count + 1, Convert.ToDecimal(row[column]));
}
}
foreach (decimal someVar in Dict.Values)
{
OleDbCommand command = myAccessConn.CreateCommand();
OleDbTransaction trans = myAccessConn.BeginTransaction();
command.Transaction = trans;
command.CommandText = "SELECT COLUMN FROM my_tb2 WHERE ROW='" + someVar + "'";
command.ExecuteNonQuery();
nb = Convert.ToString(command.ExecuteScalar());
comboBox2.Items.Add(nb;
trans.Commit();
}
It's working, but it takes a long time to execute and I have many queries in my function. How can I change the code to reduce the time of the request?