473,574 Members | 3,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The OleDbCommand is currently busy Open,fetching

6 New Member
i am getting an error like The OleDbCommand is currently busy Open, Fetching.
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
Mar 7 '07 #1
3 2691
4,871 Recognized Expert Specialist
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
6 New Member
but then my id is an integer.i tried its datatype mismatch
Mar 8 '07 #3
23 New Member
Have you pasted the exact code from your editor?
your first reader is
Rdr1 = OleDbSelectComm and1.ExecuteRea der()
and the second reader is
Rdr2 = OleDbDataAdapte r1.SelectComman d.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

by: jerim | last post by:
Hi I have the following Problem: I have an Access DB. Tablename: Formate; TableColoumns: ID (=Numeric) Name (=string)
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 performs fine when i'm using OledbCommand to execute it there would be an exception raise "Syntax Error insert into" Why is this so? Here is a...
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 an exception if the file is busy while its constructor is attempting to open it. I would prefer to simply make some form of call that will test if...
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 where loginid = @cocode " oleCommand.Parameters.Add("@cocode", OleDbType.VarChar, 10).Value = "1001" or oleCommand.Parameters.Add(new...
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 server rather than a XML file containing the users free/busy status for the specified time period. I've spent all day looking for solutions to this...
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. When the code gets to This line.. If objDoc.loadXml(objRequest.ResponseText) Then The results return False and I don't receive any data. Does...
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. Stop() to stop execution There are problems to use HTTPWebRequest.GetResponse as it lock main thread. any ideas?
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 parameters." - but I can't work out what parameters where. Can someone help? <html>...
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 table inserted but some not. But I get this error: The SqlCommand is currently busy Open, Fetching. Description: An unhandled exception occurred...
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.