I/O Operation Has Been Aborted
Jun 11, 2012
when I came across an error (The I/O operation has been aborted because of either a thread exit or an application request) regarding this code:
"Private Sub SerialPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles SerialPort1.DataReceived
If closingdown = False Then
received = SerialPort1.ReadTo(vbCr & "R") 'Motion port receiving data. needs a vbCR & "R" is sensor out is an ASCII "R" followed by three characters(which is the distance measured)
End If"
It only occurred on "received = SerialPort1.ReadTo(vbCr & "R")".
However sometimes this error is not shown, but most of the time it does occur.
This error only occur when i want to close the form. Other than that it's perfectly alright.
View 6 Replies
ADVERTISEMENT
Jan 11, 2010
I am using System.IO.Ports.SerialPort in my project. This is the first time I am using this component.
Let me explain the issue. My desktop is connected to a weigh scale where I am taking the readings through the COM port. In a particular function I need to give new settings (Baud, Parity, StopBits, DataBits) to the serialport. So I am closing the existing object, and opening it again with new settings.
I am getting "The I/O operation has been aborted because of either a thread exit or an application request." exception while closing the serial port. The code is follows
If frmMDI.SerialPortReader.IsOpen Then
frmMDI.SerialPortReader.Close() //Exception comes here
End If
View 1 Replies
Apr 22, 2011
I have an app in vb net 2005 which has code similar to' start external thread ShowRandom Images.start Open database & do other preliminary setup 'abort thread ShowRandom Images. abort 99 times out of 100 I never get a problem, but if system appears to be slow or other heavy processing, I get "Thread being aborted"..How can I trap or ensure the error message does not get to my users
View 6 Replies
Jul 8, 2011
I'm using the code below in a separate (background) thread, in order to read parts from a file, so they can be uploaded.
The problem is that when the user stops the upload, the thread is sometimes aborted while it's still reading from the file. This keeps the file locked and when the user starts the upload again, the following message appears.[code]...
View 4 Replies
Dec 2, 2009
while looping through a short XML file called from xmltextreader retrieved from a webservice, I'm repeatedly getting the error: The request was aborted: The connection was closed unexpectedly. it constantly dies a row or two from completing the parsing.here's my short code:Code:
'Get the principal-id for Group Dim url As String = "https://xxxxx.acrobat.com/api/xml?action=principal-list&session=" & strCookie xmlRead = WebRequestToServer(url) Do While xmlRead.Read If xmlRead.NodeType = XmlNodeType.Element Then If xmlRead.Name = "principal" Then strGroupID = xmlRead.GetAttribute("principal-
[code]....
View 4 Replies
Jan 4, 2012
I'm trying to convert code from Delphi to .Net. I'm stuck on one line:
//Delphi code ss := Copy(ss, Length(ss), 1) + Copy(ss, 1,Length(ss) - 1); 'vb.net code ss = ss.Substring(0, ss.Length - 1) + ss.Substring(1, ss.Length - 1)
Delphi combines the two substrings, while .Net just concatenate them like a copy.
View 2 Replies
Feb 2, 2011
I've a VB.NET code called when I need to delete an object from DB. On Page_load I check if it's not post back (to prevent a manual refresh) and, after the deletion of the object I redirect to the caller page using Response.redirect. At this point my code raise an
[Code]...
View 3 Replies
Sep 27, 2010
I had a problem getting a VB.NET web service client to receive the response object from a Java web service.In the process of posting this question someone from another department volunteered some code written for a similar situation.I couldn't find this anywhere on the net so I'm completing my question to help others out.[code]The web service is Apache CXF with some Spring elements mixed in.
View 1 Replies
Sep 2, 2010
My understanding is that thread.join will suspend the execution of code on the calling thread until the spawned thread finishes or is aborted...
With that in mind, I tried this:
For i = 1 to 50
threads = New Thread(AddressOf test)
threads.IsBackground = True
threads.SetApartmentState(ApartmentState.STA)
[CODE]...
However, the rest of the code runs when the loop finishes, not waiting for all the spawned threads to finish. Since the rest of the code needs the threads to finish (otherwise the rest will error).
View 4 Replies
Aug 18, 2009
I have a program that sends some data on a networkstream through a tcp connection.
[Code]...
View 1 Replies
Jan 26, 2012
I am having two constants of 64 byte (X,Y) string type and a structure of 64 bytes with 5 parameters of different sizes like(1,7,12,20,14,10) no i have to xor operation with these three and store in a binary file. X XOR Y XOR Structure. the structure will be formed by taking user input values.
View 2 Replies
Aug 17, 2009
I want to Drag out an item from the program to the draged out Location ie. Desktop.
Mainly its a picture in a picture box that needs to be Draged and Droped from the program to the droped location on explorer
View 2 Replies
Oct 14, 2010
I have a form called frmReport and on this form a user makes selections and clicks the "btnBuild" button which in turn creates a crystal report and displays it. However sometimes this process can take some time to build the report. So I placed a panel control along with a progress bar to let the user know that the system is working. However when the form runs the progressbar does not run until the last few seconds before the report is displayed. how to get the progressbar to "run" while the report is building ? (The progress bar is set to marquee.)
Private Sub btnBuild_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBuild.Click
' Display panel control with progress bar
[Code]....
View 2 Replies
Apr 27, 2012
I want to know the behavior of string array when using For Each loop in it. Consider following code:
Dim StringArray(499) As String'fill in each element with random string
Dim count As Int32 Dim current As String For Each current in StringArray
[Code]...
As shown in the code above, if I need to access StringArray twice using For Each loop, is that true that ALL elements in StringArray will be loaded twice even though I only use 10 elements in each For Each loop? From performance point of view, is that advisable to use String array as data structure to store a list of strings that needed to be accessed multiple times, for example 20 times within a method?
View 1 Replies
Jun 16, 2010
I need to have the following : (name1 + "a") + (name2 + "a") + ...
Dim separator() As String = {"|"}
myString.Split(separator, StringSplitOptions.None).SomeLinq(...)
I don't know what to add at the end to add an "a" to each element...
View 2 Replies
Oct 28, 2010
I want to perform a bitwise-AND operation in VB.NET, taking a Short (16-bit) variable and ANDing it with '0000000011111111' (thereby retaining only the least-significant byte / 8 least-significant bits).
View 3 Replies
Jun 13, 2012
I have an array of a structure and I need to assign an element of this array to a variable of the same type. In vb6 I'd use something like the following pseudo-
View 3 Replies
May 18, 2012
I have some code that i cant work out why its happening and how to fix it. What im attempting to do is loop through the controls in a gridview and replace it with another control along with the text
Dim i As Integer
Dim row As GridViewRow
Dim rowCell As TableCellCollection = row.Cells
[Code].....
View 1 Replies
Aug 20, 2010
i have PDF forms creating .exe application using Crystal it is giving some times "Not enough memory for operation" error in production intermittently for below code. the error is not reproduced in TEST if i reset the same claim in next batch , it is creating PDF form without fail the server has enough memory the application is in .NET2003
rpt1.ExportToDisk(ExportFormatType.PortableDocFormat, sPdfFile)
View 3 Replies
Jun 25, 2011
I have installed vb.net 2010 express , but when I run It I get : "Error , the operation could not be completed".And I cannot do nothing with visual studio 2010.
View 1 Replies
Mar 12, 2012
How does the "Undo" operation work? Not looking for a specific code, I am just curious to how it works.
View 3 Replies
Sep 14, 2009
I am calling a dll function from my dowork event. When i click on cancel button, i want the background worker to stop executing thread. Im using VB 2008 Express edition.
View 1 Replies
May 26, 2011
I am using an httpWebRequest in my windows app to download files from a webserver (sURL), to a local folder (fileDestination) as such:
Public Function DownloadFile(ByVal sURL As String, _
ByVal fileDestination As String, _
ByVal WebRequestType As String) As Boolean
Dim URLReq As HttpWebRequest
Dim URLRes As HttpWebResponse
[Code] .....
This works fine for the first few files. But then it starts giving the error:
"operation has timed out"
on the URLReq.GetResponse line.
View 2 Replies
May 30, 2010
I'm working in a windows app. with vb.net it is working very fine with me but after I make it as a setup file and install it it shows an error.I will explane the problem hereunder:the App. is for importing the data from xsl.file(user select it from file dialog)and store it in DB access file. It works pretty good when it is running in VS .. but after installation it is not.The error msg: "Operation must use an updateable query.""When JIT debugging is enabled, any unhandled exception.will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box."
View 4 Replies
Apr 16, 2007
have a form onto which i've place a menu item called Exit. When I click the Exit, i expect it to close the entire application.Here is the code
Private Sub mnuExitApp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuExitApp.Click
Application.Exit()
[code].....
View 2 Replies
Nov 20, 2011
I have an error when I try update values from one data table into another.I am using microsoft access 2007.For the datatable in question I can Insert data into it no problem, but I get the following error when trying to update -
Operation must use an updateable query.I dont think it can be a permissions problem or a file access problem because I can execute an insert sql query on the same file.
[Code]...
View 4 Replies
Dec 29, 2010
I have to code in VB.Net to delete first 16 columns from given input .csv file .[code\...
View 2 Replies
Nov 4, 2009
this is the code have written am unable to perfrom the log in operation.[code]
View 1 Replies
Feb 23, 2012
I've a problem using simple logarithm function Log in some ButtonClick Event. Log is underlined with next warning:System.Diagnostics.Log is not accessible in this context because it is Friend.
Have I missed something or this happens because of the Express version of Visual Basic?
View 1 Replies
Jun 22, 2011
I'd like to read from a file and if I fail, let the user retry or otherwise give up. So far the code looks like this:
Read_Again:
Try
my_stream.Read(buffer, 0, read_len)
[code].....
View 3 Replies