473,396 Members | 1,971 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

The OleDbCommand is currently busy Open,fetching

6
hi
i am getting an error like The OleDbCommand is currently busy Open, Fetching.
code:
Expand|Select|Wrap|Line Numbers
  1. Dim book1(80) As Integer
  2.         Dim mem1(120) As Integer
  3.         Dim twod(80)() As Integer
  4.         Dim i%, k%, l%, j%
  5.         Dim Rdr1 As OleDb.OleDbDataReader
  6.         Dim Rdr2 As OleDb.OleDbDataReader
  7.         For i = 100 To 180 Step 1
  8.          OleDbConnection1.Open()
  9.             OleDbDataAdapter1.SelectCommand.CommandText = "SELECT memberid FROM histo WHERE id=" & i & " "
  10.             Rdr1 = OleDbSelectCommand1.ExecuteReader()
  11.             j = 0
  12.             While Rdr1.Read
  13.                 mem1(j) = Rdr1.GetValue(0)
  14.                 j += 1
  15.             End While
  16.             Rdr1.Close()
  17.             For k = 0 To UBound(mem1) Step 1
  18.                OleDbDataAdapter1.SelectCommand.CommandText = "SELECT id FROM histo1 WHERE memberid=" & k & " "
  19.                 Rdr2 = OleDbDataAdapter1.SelectCommand.ExecuteReader
  20.                 l = 0
  21.                 While Rdr2.Read
  22.                     mem1(l) = Rdr2.GetValue(0)
  23.                     l += 1
  24.                 End While
  25.                 'Console.Write(mem1(k))
  26.             Next k
  27.             'Console.Write(book1(i))
  28.         Next i
thanks
ramya
Mar 7 '07 #1
3 2685
kenobewan
4,871 Expert 4TB
First step is to change your select command, try:
Expand|Select|Wrap|Line Numbers
  1. OleDbDataAdapter1.SelectCommand.CommandText = "SELECT memberid FROM histo WHERE id='" & i & "'"
Here is an article that may help:
Using Parameterized Query in ASP.NET
Mar 8 '07 #2
ramyan
6
but then my id is an integer.i tried its datatype mismatch
Mar 8 '07 #3
Have you pasted the exact code from your editor?
your first reader is
Rdr1 = OleDbSelectCommand1.ExecuteReader()
and the second reader is
Rdr2 = OleDbDataAdapter1.SelectCommand.ExecuteReader

Instead of creating datareaders directly from the Adapter, why dont you create a command object and then get the DataReader from it. I mean to say that you try using the 1st method for both the DataReaders, Rdr1, and Rdr2.
Mar 8 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: jerim | last post by:
Hi I have the following Problem: I have an Access DB. Tablename: Formate; TableColoumns: ID (=Numeric) Name (=string)
2
by: Christopher | last post by:
Could Anyone help me! I'm currenly working on an application which involves SQL Statements. And my current problem is that when i execute the SQL statement on MS Access 2003 the Insert Statement...
1
by: marc.gibian | last post by:
I am writing a simple C# application to read some files in an FTP drop directory. Occasionally the program will attempt to open a file that is in the process of being written. FileStream will throw...
4
by: Agnes | last post by:
Dim authConnection As New OleDbConnection("Provider = VfpOleDB.1;Data Source = d:\cgl\vfpmaster\ttsdata\tts.dbc") authConnection.Open() Dim authCommand As String = "select loginid from coinfo...
2
by: Andy | last post by:
Hi, I'm trying to get a users free/busy status from exchange from within a website and using the code below, but when I run this a login page from MS Outlook Web Access is retrieved from the...
0
by: rnaimon | last post by:
I found the following information on this site, but I am unable to get it to work. All it brings back is the xml page with no data. I am running a Windows 2003 Server with Exchange 2003 Server. ...
10
by: x.meglio | last post by:
I'm looking for simple class to get web-page with some members to control execution: 1. string Get(string URL) - just get html-page 2. bool Busy - return true while object loading resource 3....
5
by: =?Utf-8?B?bXVzb3NkZXY=?= | last post by:
Hi, I'm trying to fill my Repeater control with the contents of a query performed on an OleDB connected database. I keep getting the error... "No value given for one or more required...
2
by: SunshineInTheRain | last post by:
I'm trying to modify a long long code within a button click by make the insert/update/delete/select using the same transaction. Purpose is to make sure every operation can be rollback instead of some...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.