private void btnUpload_Click(object sender, EventArgs e)
{
OleDbConnection conn = new OleDbConnection(cVar.conString);
conn.Open();
OleDbCommand comm = conn.CreateCommand();
//###### Read data on Access Database ######
comm.CommandText = "SELECT * FROM cycle_results where date_and_time_stamp BETWEEN #" + Convert.ToDateTime(strFrom) + "# AND #" + Convert.ToDateTime(strTo) + "#";
cVar.dataReader = comm.ExecuteReader();
if (cVar.dataReader.HasRows)
{
cVar.dataReader.Close();
dataGridView1.DataSource = null;
DataSet ds = new DataSet();
OleDbDataAdapter dataAdapter = new OleDbDataAdapter(comm);
dataAdapter.Fill(ds);
dataGridView1.DataSource = ds.Tables[0];
conn.Close();
//****** Transfer data from Datagrid to Oracle ******/
OracleConnection oraConn = new OracleConnection("user id=user;password=pword;data source=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.66.1.203)(PORT = 1521)))(CONNECT_DATA = (SID = FX21)(SERVER = DEDICATED))); Persist Security Info=True;Unicode=True");
oraConn.Open();
OracleDataReader oDR;
for (int ctr = 0; ctr < dataGridView1.Rows.Count; ctr++)
{
cVar.dataReader.Close();
OracleCommand oComm = oraConn.CreateCommand();
oComm.CommandText = "SELECT * FROM mytable";
oDR = oComm.ExecuteReader(); <<<<=== error here
if (oDR.HasRows)
{
oComm.CommandText = "UPDATE DB.. etc.. etc...
}
oDR = oComm.ExecuteReader(); = error msg: "ORA-01000: maximum open cursors exceeded"
where is the maximum cursors exceeded?
pls help. tnx




Reply With Quote