How To Report Result Back To Control Class Upon Completion

Aug 22, 2011

I need a few threads working simultaneously with URL requests in a VB.NET 2010 app. Once one of them finishes, it should continue with the next task in a list. I'm new to using threads. Since it seems like I can't declare an array of BackgroundWorker, I thought I'd have a control class that creates an instance of a task class for each task, which in turn starts a BackgroundWorker in its constructor.

However, with this approach I'm not sure how to report the result back to the control class upon completion. I had this vague idea that I could send a reference to an object in the control class (or to a public event I can trigger, is this possible?), but then I have to somehow store this address until the work is done. And I don't know how I can store the address from a ByRef for future use.

View 1 Replies


ADVERTISEMENT

Modify .net's BackgroundWorker Class So That It Fires A Custom Event Upon Method Completion?

Nov 16, 2011

I have a BackgroundWorker in a vb.net program that is doing a lengthy data import routine. I want to modify its RunWorkerAsync method so that it fires a custom event on completion of the method. (So that a method in an automated process can respond to the event and resume its work). In a sense I want to 'extend' the RunWorkerAsync method to add an extra line of code--but I can't 'see' the code in the method (to just add the line raising the event) because BackgroundWorker is an MSDN class from Microsoft.The only solution that I can think of is to 'wrap' the background worker class in a wrapper that calls the .RunWorkerAsync method and then raises the event.

Public sub wrapperMethod()
myBackgroundWorker.RunWorkerAsync()
raise customEvent
end sub

Is there a design pattern that I might use? An easy way to address this with the .net language?

PS: Unfortunately, I'm automating some clanking legacy software and backgroundworker is used in many locations, so wrapping the backgroundworker will be a bit of work and may open bugs.

View 1 Replies

Pass Query Result Into Report Parameter

Oct 24, 2011

I have an rdlc report with a TextBox that contains
=Parameters!ReportParameter1.Value

View 1 Replies

Show The Top Number Of Result On A Crystal Report?

Sep 22, 2009

When logging into my system, I select the number of result that needs to appear on the report. In my stored procedure it selects count of all the data for a period. It returns all in the information, but I only want the number of records to appear on the report that I selected at the beginning.

View 1 Replies

Ms Access - Get The Result Of Stored Procedure With Parameter And Use For Crystal Report In .Net

Jan 9, 2012

My IDE is MS Visual Studio 2008.I just want to ask how can I get the result of a store procedure from MS Access using VB.Net and use the result in a Crystal Report.

I have a Windows Application Project that requires this function.

View 1 Replies

SQL - Select Query Result In Tabular Format Like Summary Report

Nov 30, 2011

For example
month1 month2 month3 total
district1 5 2 9 16
district2 1 0 11 12
total 260 150 140 550

Here final total is not much important. But at least I need to show count per district per month.
SELECT Districts_mst.district_name,COUNT(Payments.PaymentId)users ,DATEPART(M,payments.saveon)Month
FROM Payments
JOIN Subsciber ON Payments.SubId =Subsciber.SubId
JOIN districts_mst ON districts_mst.district_id = Subsciber.District
where lang_id=1
group by district_name, DATEPART(M,payments.saveon)

Which give me list like.....
district_name users Month
dist0 1 1
dist1 1 11
dist2 3 11
dist3 1 11
dist4 3 11
dist5 1 12
dist6 1 12

View 1 Replies

Create A Report In .net 2005 Through Report Viewer Control?

Apr 11, 2010

I want to know how to create a report in vb.net 2005 through report viewer control

View 3 Replies

.net - SSRS Report Called From ReportViewer Control Displays No Data In The Report When Called With A Parameter

Apr 11, 2012

Can you look at my coding and let me know what I'm missing or doing wrong?I have a SSRS report that is called from a ReportViewer control and the ProcessingMode for this control is Remote. The report also has 1 parameter in it's DataSet.In the code I placed a MsgBox to make sure the code is finding the parameter and returning the parameter name. I am trying to stick the value of 10 into the parameter for playerID 10. Data for this player does exist.

I believe I need to add some more code to make this work but I'm not sure what else to add.

When the code executes the report is displayed but no data is shown in the report.

[Code]...

View 1 Replies

Generate Dialog Result From A Custom Message Box Class?

Aug 3, 2011

I am developing a custom messagebox class like the following-[code]...

View 1 Replies

[OOD] Class Design For With Database Back End

Feb 6, 2010

I was hoping that I could get some guidance from some of you guys on Object Design with Database back ends. I am trying to build what could be considered to be my first full scale application, which is a student tracker (simplification). While I have a reasonable idea of how I would go about designing the classes for the system, the bit that I don't know how to do is, how I would go about getting the data to and from the database.

For example with my other applications, I have done a couple of things;

1) Gathered all the data when the application started up, creating the objects then. Then when the application closed sending the data back to the database.

2) Have the code which deals with getting the data in the specific class, so the student class for example would take only one constructor argument which would be the studentID, then the class code would connect to the database and populate the object fields as appropriate.

3) Variations of the above. I have also looked into LINQ, which seems like it would be very useful if you don't expect your classes to deal with any business logic and just data, but I suppose it would be possible to create a wrapper class that would include the business logic.

[Code]....

View 1 Replies

[OOD] Class Design For With Database Back End?

Mar 11, 2010

I was hoping that I could get some guidance from some of you guys on Object Design with Database back ends.I am trying to build what could be considered to be my first full scale application, which is a student tracker (simplification). While I have a reasonable idea of how I would go about designing the classes for the system, the bit that I don't know how to do is, how I would go about getting the data to and from the database

View 3 Replies

VB Set Result Of A Control To A Variable?

May 8, 2011

trying to set the result of dropdownlist to a variable but having great troubles.

Sub OutageSource(ByVal sender As Object, ByVal e As EventArgs) Handles Year.SelectedIndexChanged
Dim year As Integer

[code].....

View 2 Replies

Using Delegates To Pass Information Back To UI From Custom Socket Class?

Oct 6, 2010

I am in the process of prototyping a small sockets application, which monitors IT infrastructure (due to in-house financial and deployment restrictions, I am unable to utilise an existing commercial or open-source solution). Basically, I have a server application and associated agent process for communicating heart-beat data to the server. The server application implements a TCP socket class (TCPDevice), which is called from a WinForm. I am aware of the restriction on updating the UI from processes running on separate threads, and that the preferred technique for acheiving this is via the use of Delegates in conjunction with the Invoke method. Having had very little need previously for using Delegates (apart from of course std windows events and the BackGroundWorker control), I am at a loss as to how to do this in the context of my application, and would appreciate some assistance, although it has occurred to me that I could use the backgroundworker for marshalling updates to the UI.

Eventually the application will need to update a grid of devices via feeds from the defined agents, however for the purpose of this exercise simply updating a status bar on the UI will suffice. The section of the code which I believe is relevant to propogating the code to the form is contained in the OnDataReceived method.Below is a code excerpt from the protoype app which should put the above into appropriate context:

Code from the form:

[code]...

View 1 Replies

Using Report Progress From Another Class?

Jun 23, 2009

I have a program that downloads information from another class, specifically it collects domain names.So i have a class called domainscraper....on my main form I have a background worker and progressbar, and i put this in the dowork event:DomainCollector.GetDomainsByMethod(parameter)Now my question is, how could I report progress to my progress bar on form1.vb from that method I use in the the domainscraper class (domainscraper.vb).

View 5 Replies

Finding The Right Control To Show Result For Print?

May 18, 2009

I have a situation to show response coming back from host in some control of a Form and want to print it.The response is coming from Host mainframe system in text based format. I want to show the response in a graphical format. I am looking for suitable control that help me to print and should look like word document. I looked PrintPreview and PrintDocument controls but my requirement is there should be some control on Form where my formatted output should be placed (like Rich Textbox). Which control I should use.

View 6 Replies

.NET Multithreading / Calling Invoke On A UI Control From A Class In A Separate Class File?

May 13, 2011

Example:

Two files - TestClass.vb, myForm.vb

TestClass.vb looks as follows:

Imports System.Threading
Public Class TestClass
Private myClassThread As New Thread(AddressOf StartMyClassThread)

[code]....

The result:Application runs, no errors or exceptions.Displayed is the listbox and the Start button.I press the start button and a msgbox says "Not Invoked" as expected and upon clicking OK to that msgbox "Start Button Pressed" is added to the Output listbox control.Immediately following that the msgbox pops up again and says "Not Invoked". I was expecting "Invoked" as a separate thread is trying to use the Output listbox control.Of course this results in the Output.Items.Add being attempted which results in no visible result as the thread is not allowed to directly update the UI control.

View 1 Replies

Getting Search Results And Adding Each Result To Treeview Control?

Jun 12, 2011

I'm having a problem with part of my application I'm trying to get the directory entry for a computer object in AD (it could be mutiple computer objects based on whether or not the users passes a wild card for the object name). These names would be added add a child node of the parent node "Computers" in the tree view. I'm just having problems with using the search results...

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim parentCNNode As TreeNode = New TreeNode("cn")
TreeView1.Nodes.Add("Computers")

[code].....

View 3 Replies

VS 2008 Component Class - Drag And Drop Control Onto New Class

Nov 21, 2009

I am searching for the Component Class. When I go to "Add New Item" ,in my project their is no Component Class Item in VS 2008. I would like to Drag and Drop control onto my new class and I can't see how to do this ?

View 6 Replies

MS ACCESS - Putting A Query Result Into An Ubound Textbox Control?

Jun 26, 2009

I am working on a custom report in access and I do have a query which I want the outcome to appear in a text box control. Howver when I link this under the control source property, It returns an error.

View 1 Replies

Reference A Report Variable In The Report Properties Code Window Of A Local Report?

Apr 19, 2011

how I can reference a report variable in the Report Properties Code Window of a local report? I have tried Variables!Claimant.Value (for a variable called Claimant) but I get an error "Reference to a non-shared member requires an object reference." I have tried qualifying it with Report. and also with the report name in front of it but I get errors with this also.I have the variable CLaimant defined in the Variables section of the Report Properties.

View 3 Replies

Asp.net - Telerik Upload Control In DNN Just Posts Back Without Uploading?

Jul 13, 2011

Ultimately, what I would like to do is upload files directly into the database, so I updated this question with the code I'm using to write to the database. I am developing a module in DotNetNuke using Telerik controls. I need to upload files to the server in the user interface, so I am using the RadUpload control and the RadProgressArea/RadProgressManager.

Here is my ASP:

<telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="CheckBoxes, RemoveButtons, ClearButtons"
AllowedFileExtensions=".doc,.docx,.pdf,.tiff,.gif,.jpg,.jpeg,.xls,.xlsx" MaxFileInputsCount="2"
MaxFileSize="10000000" InitialFileInputsCount="2">
</telerik:RadUpload>

[Code]...

When I hit the button, it does a postback to the page, but the files do not get uploaded. I tried using the autoupload functions and specifying pysical and virtual paths but that didn't work. I did it exactly like they said. I manually registered the controls in my web.config, then removed them and used the auto-register feature to re-register thinking maybe I did something wrong, but I'm still at a loss.

Here's where I spent the last couple hours:
[Upload Overview][3]
[Files are not uploaded][4]

get this upload control and progress indicator working?

View 1 Replies

Making A Method Excute Right Before The User Gets Control Back?

Sep 17, 2009

I would like to make a method excute right before the user get back controle of the program. No matter what chain of events happens i would like to beable to have a method is always the last thing to excute. I plan on using the method to check the form and the data on it. I have no issues righting the method, I just don't know if their is a event or some other way to make sure it is always the last thing to excute. (Sorta like a validation method) Is their an easy way to do this?

View 5 Replies

VS 2010 Control Array - Print For Each Loop The Random Result In One Of The Text Boxes?

Aug 13, 2010

I'm trying to lern VS 2010 from VB 6 and one of the things i'm hawing a problem whid is control array.In vb 6 if you create a text box it's named "Text1" and if you yust copy it and paste it it renames to "Text1(0)" and the new one's name is "Text1(0)" and the code would lock like this

[code]...

then it would print for each loop the random result in one of the text boxes corresponding to i.

How do i do this in VS 2010?

View 39 Replies

Using List Of Custom Class Object As Data Source For Crystal Report

May 24, 2011

I am trying to find way to design a report using my own custom class. I found links:

1.) How to work in Crystal Report with Object Data Source?

2.) Use .net object as data source in Crystal Report 2008

3.) Binding object with List<> to Crystal Report

4.) How to assign Custom class as datasource in crystal report

They were quite helpful, but I have been stuck in the first step while designing report as my custom class's property is not listed in field list of crystal report design view.[code]When I add my class objects to crystal report I do not get the usertype field from users class in field list.So how can I add usertype field to my field list? Or do I have to take another approach?The reason i wanted to use it as i am:

1.) Showing a form where user can type keyword
2.) program filters the records as per keyword using LINQ
3.) when user clicks the print button, I want to set the filtered records as datasource of my report

View 3 Replies

Custom Control And Datagridview ComboBox Cell Back Color

Jun 5, 2009

I have added a custom Control to my project, but every time I edit it and rebuild the form that I use the custom control in adds the project name in front of the control and won't compile. i.e. Project name = MyProject, Custom Control name = MyControl. When I rebuild the project after editing my control I get an error, MyProject.MyControl doesn't exist. If I remove the MyProject from the line it compiles and runs fine until next time I edit the custom control.

I can't figure out what I would be doing wrong to cause this, or why it is putting the project name in front of the control, but then not accepting it. I am also struggling figuring out how to change the back color on an individual cell in an Datagridview Combo Box. The style.backcolor property of the cell doesn't seem to do anything.

View 2 Replies

Way To Receive Click Events Back To Form From A WebBrowser Control

Jan 22, 2012

I've been trying to figure out a way, to receive Click events(Clicking a Link) back to the form from a WebBrowser control, as the BeforeNavigation2 event does not fire in either VB/C#.Has any body got any ideas how to do this as All the example I've seen in the past just dont seem to work in VS2010

View 6 Replies

User Control Which Works As A Login Control Using Windows Class Library

Feb 12, 2009

I Need Build a user control which works as a Login control using Windows Class Library or Component Template:The user control returns the user name and the password It means that the control has minimum two ReadOnly Property procedures. You let the user of your control (he/she which uses your control in his/her software) to set the background colour of the two labels. Create a Windows application to test your control.

View 10 Replies

Inheritance A Classic React Class Into A User Control To Add The Hight And Width Properties To The Control?

Feb 28, 2011

I tried it and get an error but maybe I'm tring the wrong way. Can a usercontrol inherate an application defined class ie.. could you inheritance a classic rect class into a user control to add the hight and width properties to the control without having to do all the coding all over again? Currently I just declair a private instance of the class within the control and then encapsalate. It would be nice if I could just inherit all the functionality of my classes into controls designed to implament the classes.

View 1 Replies

VB Comments In Completion Box?

Dec 30, 2010

I do not understand vb comments. I read that it is possible to give a hint in the code completion box when someone (or myself?) is using my code. But I do not find something in visual studio.

View 4 Replies

End Result Of Combobox Selection Keep Showing Same Multiple End Result When There Is Only One Entry?

Dec 10, 2010

I am currently having a headache on how to solve this problem that i am facing. here is the situation: I have a combobox and a list box on the main form. The combobox will get the data from the ms access database. In the database, i have the details of a person's IC, Name and DOB say for eg on one entry I have D215311523C,SHAWN,13/04/1987 So now, my combobox on form load will show the list of dates in the database to allow the user to search base on the date itself by clicking on the selected date. So when the user clicks on the particular date say 13/04/1987, people in the database whose birthday is 13/04/1987 will be shown on the listbox.Meaning to say if i have 3 entries whose dates are the same 13/04/1987, 3 entries will appear. If there is only two entry, then two results will be shown. But now, when i do a single click on the date, one result will be shown. That is correct. But the problem is when i click on the same date again, three of the same results will be shown on the list box. that is it will display : 13/04/1987 13/04/1987 13/04/1987 which is not the case. Then it will show more duplicates of the same results if i click more times on the same date which should not be the case.

Dim n As Integer
Dim numbers() As Integer
Dim StartFrom As Integer
Dim EndAt As Integer

[code].....

View 3 Replies







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