Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Cannot open any more Tables

Cannot open any more Tables

Scheduled Pinned Locked Moved ASP.NET
comsysadminsaleshelp
10 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Khan Bangash
    wrote on last edited by
    #1

    Hi all, I have a page which works fine on my local computer, but when I upload it to my server it gives the following error. Can any one tell me the reason of that error and possible solution for that. System.Data.OleDb.OleDbException: Cannot open any more tables. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.ExecuteReader() at cust_order.custOrdDes() in c:\domains\etradehouse.com\wwwroot\code\adm\cust_det\adm_order_det.aspx.vb:line 2090 and the code of that sub is given belown Public Sub custOrd() customerAsc.Clear() customer.Clear() Try If Conn.State <> 0 Then Conn.Close() End If Conn.Open() SelectQuery = "select order_id from cust_order" command = New OleDbCommand(SelectQuery, Conn) total = command.ExecuteReader() While total.Read ordAsc.Add(total.GetValue(0)) End While Dim i As Integer For i = 0 To ordAsc.Count - 1 SelectQuery = "SELECT customers.customer_id,customers.customer_type FROM customers INNER JOIN cust_order ON customers.customer_id=cust_order.customer_id WHERE cust_order.order_id=" & ordAsc(i) & "" command = New OleDbCommand(SelectQuery, Conn) total = command.ExecuteReader() While total.Read() cstAsc.Add(total.GetValue(0)) typAsc.Add(total.GetValue(1)) End While Next total.Close() total = Nothing Dim k As Integer For k = 0 To cstAsc.Count - 1 If typAsc(k) = 1 Then SelectQuery = "Select comp_name, customer_id from biz_cust_extra where customer_id = " & cstAsc(k) command = New OleDbCommand(SelectQuery, Conn) total = command.ExecuteReader() While total.Read() If Not total.IsDBNull(0) Then customerAsc.Add(tot

    _ 1 Reply Last reply
    0
    • K Khan Bangash

      Hi all, I have a page which works fine on my local computer, but when I upload it to my server it gives the following error. Can any one tell me the reason of that error and possible solution for that. System.Data.OleDb.OleDbException: Cannot open any more tables. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.ExecuteReader() at cust_order.custOrdDes() in c:\domains\etradehouse.com\wwwroot\code\adm\cust_det\adm_order_det.aspx.vb:line 2090 and the code of that sub is given belown Public Sub custOrd() customerAsc.Clear() customer.Clear() Try If Conn.State <> 0 Then Conn.Close() End If Conn.Open() SelectQuery = "select order_id from cust_order" command = New OleDbCommand(SelectQuery, Conn) total = command.ExecuteReader() While total.Read ordAsc.Add(total.GetValue(0)) End While Dim i As Integer For i = 0 To ordAsc.Count - 1 SelectQuery = "SELECT customers.customer_id,customers.customer_type FROM customers INNER JOIN cust_order ON customers.customer_id=cust_order.customer_id WHERE cust_order.order_id=" & ordAsc(i) & "" command = New OleDbCommand(SelectQuery, Conn) total = command.ExecuteReader() While total.Read() cstAsc.Add(total.GetValue(0)) typAsc.Add(total.GetValue(1)) End While Next total.Close() total = Nothing Dim k As Integer For k = 0 To cstAsc.Count - 1 If typAsc(k) = 1 Then SelectQuery = "Select comp_name, customer_id from biz_cust_extra where customer_id = " & cstAsc(k) command = New OleDbCommand(SelectQuery, Conn) total = command.ExecuteReader() While total.Read() If Not total.IsDBNull(0) Then customerAsc.Add(tot

      _ Offline
      _ Offline
      _mubashir
      wrote on last edited by
      #2

      I see you havnt closed your reader 'total' after the first query. try, total.Close()


      Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.

      K 1 Reply Last reply
      0
      • _ _mubashir

        I see you havnt closed your reader 'total' after the first query. try, total.Close()


        Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.

        K Offline
        K Offline
        Khan Bangash
        wrote on last edited by
        #3

        Now I close it but it still gives the same error. Can u tell me what is the reason and possible solution for that.

        _ 1 Reply Last reply
        0
        • K Khan Bangash

          Now I close it but it still gives the same error. Can u tell me what is the reason and possible solution for that.

          _ Offline
          _ Offline
          _mubashir
          wrote on last edited by
          #4

          OK, see this For i = 0 To ordAsc.Count - 1 SelectQuery = "SELECT customers.customer_id,customers.customer_type FROM customers INNER JOIN cust_order ON customers.customer_id=cust_order.customer_id WHERE cust_order.order_id=" & ordAsc(i) & "" command = New OleDbCommand(SelectQuery, Conn) total = command.ExecuteReader() While total.Read() cstAsc.Add(total.GetValue(0)) typAsc.Add(total.GetValue(1)) End While Next Here you are looping thru some list and executing reader without closing it. That is why it is throwing exception. Make sure you close the reader after you finish fetching records.


          Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.

          K 1 Reply Last reply
          0
          • _ _mubashir

            OK, see this For i = 0 To ordAsc.Count - 1 SelectQuery = "SELECT customers.customer_id,customers.customer_type FROM customers INNER JOIN cust_order ON customers.customer_id=cust_order.customer_id WHERE cust_order.order_id=" & ordAsc(i) & "" command = New OleDbCommand(SelectQuery, Conn) total = command.ExecuteReader() While total.Read() cstAsc.Add(total.GetValue(0)) typAsc.Add(total.GetValue(1)) End While Next Here you are looping thru some list and executing reader without closing it. That is why it is throwing exception. Make sure you close the reader after you finish fetching records.


            Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.

            K Offline
            K Offline
            Khan Bangash
            wrote on last edited by
            #5

            Can u pls tell me where should i close reader in my code. I m new to programming so why i m facig problems.

            _ 1 Reply Last reply
            0
            • K Khan Bangash

              Can u pls tell me where should i close reader in my code. I m new to programming so why i m facig problems.

              _ Offline
              _ Offline
              _mubashir
              wrote on last edited by
              #6

              Sure.. For i = 0 To ordAsc.Count - 1 SelectQuery = "SELECT customers.customer_id,customers.customer_type FROM customers INNER JOIN cust_order ON customers.customer_id=cust_order.customer_id WHERE cust_order.order_id=" & ordAsc(i) & "" command = New OleDbCommand(SelectQuery, Conn) total = command.ExecuteReader() While total.Read() cstAsc.Add(total.GetValue(0)) typAsc.Add(total.GetValue(1)) End While total.Close() '<--- Next See above, right after the while loop. I see you have the same mistake in all your code. Fix them with the same


              Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.

              K 1 Reply Last reply
              0
              • _ _mubashir

                Sure.. For i = 0 To ordAsc.Count - 1 SelectQuery = "SELECT customers.customer_id,customers.customer_type FROM customers INNER JOIN cust_order ON customers.customer_id=cust_order.customer_id WHERE cust_order.order_id=" & ordAsc(i) & "" command = New OleDbCommand(SelectQuery, Conn) total = command.ExecuteReader() While total.Read() cstAsc.Add(total.GetValue(0)) typAsc.Add(total.GetValue(1)) End While total.Close() '<--- Next See above, right after the while loop. I see you have the same mistake in all your code. Fix them with the same


                Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.

                K Offline
                K Offline
                Khan Bangash
                wrote on last edited by
                #7

                I have done according to ur answer but now another problem occured and following error occured. The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings

                _ 1 Reply Last reply
                0
                • K Khan Bangash

                  I have done according to ur answer but now another problem occured and following error occured. The page cannot be displayed The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings

                  _ Offline
                  _ Offline
                  _mubashir
                  wrote on last edited by
                  #8

                  Good, so you are out of one problem. Now it seems like your program stuck into a never ending loop. It is a typical logical error, try debugging your code.


                  Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.

                  K 1 Reply Last reply
                  0
                  • _ _mubashir

                    Good, so you are out of one problem. Now it seems like your program stuck into a never ending loop. It is a typical logical error, try debugging your code.


                    Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.

                    K Offline
                    K Offline
                    Khan Bangash
                    wrote on last edited by
                    #9

                    Thank u very much dear. Now I will find out what is the error. I think u r Pakistani. I m also Pakistani. My name is Arif Bangash. And I m new to programming. Will u help me in making myself a good programmer. Can u pls give me ur email address with help of which I can contact u.

                    _ 1 Reply Last reply
                    0
                    • K Khan Bangash

                      Thank u very much dear. Now I will find out what is the error. I think u r Pakistani. I m also Pakistani. My name is Arif Bangash. And I m new to programming. Will u help me in making myself a good programmer. Can u pls give me ur email address with help of which I can contact u.

                      _ Offline
                      _ Offline
                      _mubashir
                      wrote on last edited by
                      #10

                      Yea I am a proud Paki ;) you can find me on mubashir01@hotmail.com regards,


                      Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups