Results 1 to 4 of 4

Thread: ORA-01000: maximum open cursors exceeded

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Location
    /root/usr/local/bin
    Posts
    476

    ORA-01000: maximum open cursors exceeded

    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
    *****************
    VB6,PHP,VS 2005

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: ORA-01000: maximum open cursors exceeded

    How many iterations of the loop are completed before that exception is thrown?

    Also, can you please use tags with your code? After 269 posts that should be a given.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: ORA-01000: maximum open cursors exceeded

    What version of Oracle? What is the Max_Cursor value set in the .init file set to (or the sfile).
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2006
    Location
    /root/usr/local/bin
    Posts
    476

    Re: ORA-01000: maximum open cursors exceeded

    the iteration of "ctr" is equal to 300

    if i set my time below only 4 rows found and no prob.
    but when rows found are many it will display the "max cursors"

    dtpFrom.Text = "12/12/2007";
    dtpTo.Text = "12/12/2007";

    how do i solvd?, is there a conflict connecting access at the same time in oracle?
    *****************
    VB6,PHP,VS 2005

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width