DataReader Read() Command Hangs For Up To 30 Minutes

Jun 24, 2010

I have a datareader pulling data from Oracle. It all works fine but I have one issue. When I issue the read() command ala;

While dr.Read
Column1List.Add(dr.GetValue(0).ToString().Replace(vbCrLf, ""))
Column2List.Add(dr.GetValue(1).ToString().Replace(vbCrLf, ""))

[Code]....

When the code hits that " While dr.Read" line it will hang there for up to 30 minutes which is just a ridiculous amount of time to advance to the next record, which is what the documentation says is all that is happening here. It only occurs the first time it hits that line...once it gets past it once, it does not hang again as it goes through it's while loop.

View 3 Replies


ADVERTISEMENT

VS 2008 - DataReader While Loop (Hang After Few Minutes)

Sep 9, 2009

How come my datareader looping at the while loop line it become totally no response and without error eventhough I got use the try catch error catching... it only will hang on after few minute... after few loop. Is it the data reader got time out limit?? If exceed the limit it will no response..? Inside my while loop it do a lot of transaction and each transaction also take quite long time... it will affect?

myCommand = New MySqlCommand("SELECT * FROM stk_cus_inv_hd WHERE DocType=?DocType;", conn1)
myCommand.Parameters.AddWithValue("?DocType", "CS")
myCommand.CommandTimeout = 99999
myReader = myCommand.ExecuteReader
While myreader.read <<---- it jam at here and totally no response my coding... but my interface is clickable...
my lot of work here...
End While

View 11 Replies

Comm Port Read Hangs When Attempting To Read Data?

Apr 18, 2010

I;m attempting to write code to read several NMEA ports and format the data for archive. When I execute the following code:

Using Commportno As IO.Ports.SerialPort = _
My.Computer.Ports.OpenSerialPort(portName:=port)
Dim Incoming As String = Commportno.ReadLine()

View 5 Replies

There Is Already An Open DataReader Associated With This Command

Mar 13, 2012

There is already an open DataReader associated with this Command which must be closed first

Dim staffid = TextBox1.Text
Dim conn As New SqlConnection
conn.ConnectionString = SqlDataSource1.ConnectionString

[code]....

View 4 Replies

Error: There Is Already An Open DataReader Associated With This Command

Jul 12, 2009

I have two datareaders: [Code] When i'm running the code i get this error in the highlighted line: "There is already an open DataReader associated with this Command which must be closed first." I used different variables in both readers, why do i get this error? do i have to open a new sqlConnection for this task?

View 13 Replies

Open DataReader Associated With This Command Which Must Be Closed First?

Feb 7, 2011

Ok...i have read all posts..and no solution...on main form I have...

adapSB.Connection.ConnectionString = "Password=xxx;Persist Security Info=True;User ID=xxx;Initial Catalog=dbone;Data Source=xxx
adapSB.Fill(DTSB)

and in class that starts new thread started every time users change some data(very often)

[Code]...

1. other parts of application are targeting other SQL server...just this adapter is updating only one row(table has two columns, some id and last time any of users changed something.

View 4 Replies

There Is Already An Open DataReader Associated With This Command Which Must Be Closed First

Feb 20, 2012

This reader is done in the form load event and is the very first thing done so I don't understand why it's telling me there is an open DataReader. I've also set MARS=True in my connection string so obviously it is something else.Here's my code and like I said the routine is called at the top of the form load event. The error occurs on the

Reader_Customer = command.ExecuteReader() line:
Module Globals
Public g_strConnectionString As String = "workstation id=" & System.Environment.MachineName & ;" _ & "packet size=4096;Connection Timeout=60; " _

[code].....

View 4 Replies

Error - There Is Already An Open DataReader Associated With This Command Which Must Be Closed First

Oct 14, 2009

I get the following message "There is already an open DataReader associated with this Command which must be closed first." Is the insert statement the most effiecient way to write to the table row by row?

Dim comment As String Dim cnx As Data.SqlClient.SqlConnection = SqlCnx.SourceDB Dim cmd As New Data.SqlClient.SqlCommand("select number,comment from [Comments]", cnx) Dim daComments As New SqlClient.SqlDataAdapter Dim bsComments As New BindingSource cmd.CommandTimeout = "360" cmd.CommandType = CommandType.Text cnx.Open()

[code]....

View 3 Replies

VS 2008 Recursion Failing With Command/DataReader Objects Already Open

Jun 26, 2009

I'm trying to put together a quick example for another thread about treeviews, and I'm getting a problem when I have a recursive routine, getting the message.

Quote:

There is already an open DataReader associated with this Command which must be closed first.

I'm a tad confused as I am explicitly creating a new command every time through the loop, so I'm not sure (unless its something ADO is doing behind the scenes) how the datareaders higher up the tree are interfering.

Here's my code :

Private Sub SetupChildren(ByVal ParentID As Integer, ByRef ParentNode As TreeNode)
Dim MyCommand As New SqlCommand("SELECT * FROM Groups WHERE ParentGroup=@ParentGroup", m_myConnection)

[Code]...

Obviously I could close the data reader down before calling the next level of recursion but it would prevent the code continuing the loop at the current level when it had finished processing children.

View 5 Replies

Read XML Files In A FOLDER Every 15 Minutes?

Apr 10, 2009

Recently i have to develop a program for my company which require: -

1. A parameter for me to put in a path of a list of XML files.

2. Read those XML files 1 by 1 and convert it to another XML files based on a XSL file uploaded.

3. Output the transformed XML files to another folder.

I was thinking using VB.NET for development.

To all forumer out there, is it difficult to develop and how and where i should start?

View 1 Replies

Asp.net - DataReader.Read() Skips First Row Of Recordset

Nov 25, 2011

I am trying to check the value of a field before decided what to input into a drop down list in ASP.net.

I am using datareader.Read() in order to read the recordset so I can do this. However this then skips the first row of data . . The drop down box is basically a list of sizes and colours . . . So currently I am missing the first size.

Here is the code:

Using cmd As New SqlCommand("doGetAllSizesForProduct", oConn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@id", CType(Request.QueryString("id"), Integer))

[Code].....

View 3 Replies

Read DataReader Null Value In To Textbox?

May 18, 2010

What i want to do is to read a value either null or not null from my oracle database using DataReader and store in a textbox. But i have an error.InvalidOperationExcepionHow can i avoid this error.Or is it possible to catch the exception to ignore null values read by the datareader?If the option is to catch the exception how may i do it?

Dim Dr1 As OleDb.OleDbDataReader = Cmd3.ExecuteReader
Dr1.Read()
lect_name = Dr1.GetValue(1).ToString

[code].....

View 2 Replies

Format A Text Box So The Values Entered Are Read As Minutes

Apr 4, 2010

In order to pass on the right time to my access database i need to format a text box so the values entered are read as minutes.

View 1 Replies

Sql - Datareader To Read A Data From Database Filter And Show In Textbox?

Apr 27, 2011

i have a form with one combobox and textbox now on other hand i have a sql database named balance with two column one as customername and and another as obbalance now i had binded all the customer name to the combobox now what i have to do is wen user selects a customername from the combobox the textbox should show the obbalance of the selected?

View 1 Replies

VS 2010 : Create Multi-dimensional Array From Datareader From Datareader?

Feb 20, 2012

I have an SQL statement like:

SELECT FNAME, LNAME, CITY from EMPLOYEE

How do I create a multi-dimensional array from a datareader which should store values like:

John, Doe, LA
Mike, Johnson, PASADENA
Freddy, Kruger, Long Beach

View 3 Replies

Convert Minutes Into Decimal Minutes?

Jul 21, 2009

I am looking for formula that is accurate in converting Minutes to Decimal Minutes i.e 30 minutes is 50 Minutes in Decimals so 1.3 hours is 1.50 and not 1.5 i have used Minutes/60 but it is not accurate as some times i have to Multiply the result by 100 and some time 1000 to get correct results based on single digit Try 1/60, 10/60 99/60 or 100/60.What would be the most efficient and correct way to Convert the time into Minutes ?

View 10 Replies

Datareader - Error - "there Is A Datareader Associate With This Connection That Need To Be Closed"

Aug 17, 2009

I have a problem with my project. here is the problem:

My code for login is as follows:

dim conn as SqlConnection = New SqlConnection("Data Source.................)
dim cmd as SqlCommand = New SqlCommand("Loguser",conn)
cmd.CammandType = CommandType.StoredProcedure

[CODE]...

Now the error i get is that "there is a datareader associate with this connection that need to be closed"

View 4 Replies

Read From Command / DOS Window

Jul 30, 2009

I'm looking to read from a command prompt window so I can redirect the output to my project. I've looked all over the net and the only codes that I've seen don't work in VB 2008.

View 1 Replies

Read From Command Line?

Oct 3, 2009

I'm making a program that has to execute commands in cmd.exe, but without actually opening it. I set RedirectStandardOutput to True, and I need a way to read the result of the command from the stream. Right now, I use ReadToEnd(), but there's no end to the stream, apparently. How do I read the result of the command?[code]...

View 2 Replies

Read And Write To And From Command Prompt?

Apr 28, 2008

I'm working on a small project that lets me read and write to and from command prompt, i have this code but one line does not work .Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click[code]...

View 6 Replies

Read From Command Line Application?

Aug 19, 2009

How can I get a label to display what a command line application is showing. I made it so it can show the final result, but I want it to update live as the app is running.

View 2 Replies

Read/Write Command Prompt

Mar 12, 2010

I have made an application that requires executing an external command prompt application, and I need to be able to read the result from its completion of each file it processes.

The external application works by specifying an input directory, it then scans for a series of compatible files and then converts them all one by one in a single command. I need to be able to read each line it writes and provide the appropriate feedback in my application. It would be nice if i could hide the window it creates too. Code I have tried working from:

Code:
Private Sub btnRead_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRead.Click
Dim CMD As New Threading.Thread(AddressOf GETCMD)

[Code]....

View 6 Replies

Read Command Line From Console Application?

Mar 15, 2010

Just wondering if there is anyway to read each line of text that is output from a console application?

Basically I want to use PSEXEC through a vb.net GUI application and I would like to be able to read any error codes that may occur from the command line.

View 3 Replies

Read Line From Textfile And Proceed With Command

May 21, 2009

how do i have my app read a line from a textfile and if that line equals "whatever" proceed with command, this case a msgbox.so much work to do and so many choices to choose from...

View 3 Replies

Read The Text File And Trim Command?

Aug 15, 2011

how to apply the correct syntax to read the text file which is in C drive

I just wondering how to apply on it in my coding.

Here is sample text files i would like to create the program to read the text files content:

Example:

0x0C03C6ED Wed, 27 Jul 2011 00:33:18
0x0C038E28 Wed, 27 Jul 2011 00:36:29
0x0C039289 Wed, 27 Jul 2011 00:39:51

[Code].....

View 3 Replies

VS 2008 Read And Command Line Output

Sep 15, 2009

I am using this to capture output from the command line: url...Is there a way to modify that, so I can get the results as they are updated? [code]Is there a way to capture that output every time it is updated so I can change a text box as it get updated?

View 1 Replies

VS 2008 Read And Command Line Output?

Mar 16, 2010

I am using this to capture output from the command line:Is there a way to modify that, so I can get the results as they are updated?

View 3 Replies

IDE :: Read And Parsing Strings From CSV Or Text File As A Command

Feb 18, 2010

I'll start off by saying I am using Visual Studio 2008 Standard. I am creating a program that will open installed programs using short code. For instance, if a user types in 'npp' then Notepad++ opens. I have it working just fine to respond to the predefined commands, but I would like to expand it so that the user can define their own settings simply by typing the program directory and the custom short code they want: Example: If I am an end user and would like to say define a short code for Windows Media Player, I would simply type the following: (Assuming Excel or likewise is used to open the csv file).

[Code]....

View 3 Replies

Read Lines From Command Line To Windows Form?

Jun 9, 2010

Hey Overflow, I have an application which serves as a user interface for a spartan/command line program.

I have the program running on a separate process, and my application monitors it to see if it is responding and how mush CPU it is utilising.

Now I have a list of files in my program (listbox) which are to be sent to the application, which happens fine. But I want to be able to read text from the com-line so as to determine when the first file has been processed.

Com-line says one of "selecting settings", "unsupported format" and "cannot be fixed". What I want to be able to do is when it says one of these three things, remove item(0) in listbox1.

I thought of programming an event which handles com_exe.print or something or other, if possible.

View 2 Replies

Application That Provides A Countdown For 60 Minutes / Change To Be A Countdown For 360 Minutes?

Apr 14, 2011

I have an application that provides a countdown for 60 minutes and I'm currently using the win form timer and it updates some labels and a progressbar. Now I have to change this to be a countdown for 360 minutes. Will the win form timer be sufficient or should I implement a Timers.Timer instead?

View 6 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved