Winform Update GUI Between Syncronous Sql Calls?

Jul 15, 2011

I have a (presently) single threaded application written in VB.Net The major processing steps are 12 checked list items in a treeview control. The program executes the steps (functions, and stored procedures) in turn and checks the result before continuing.The steps (greatly simplified) are:

1. Import data from a txt file

2. Bulk Insert it into a database

3. Do some processing

4. Use that data to retrieve a lot more related data across a network in a complex join from a linked server.

5. Update the local database with the results

6. Do more processing

7. Insert the final results into a different database on a different server.

I won't go into all the reasons it had to be done this way like (different server owners within the company, lack of trust between servers, read only access to certain databases, etc.) but the problem is Step 4.Depending on the processing load on the (foreign) server and the amount of data in the import file, this step can take 1-1/2 hours to execute. Since this is a single threaded app the gui freezes waiting for the data to be retrieved from the linked server.Aside from the grey block on the desktop (due to no gui updates) the program runs perfectly.

Attempted solutions:

1) I tried the suggestion of a timer to refresh the form with no success.

2) I have tried using the background worker process but could not get the application to wait for a result before the program continued.

3) I also tried different examples of threading with no success. All the other steps complete so quickly that the gui never freeses, but I wouldn't be averse to threading all my sql calls in this app.

Imports System.Runtime.InteropServices
Imports System.Threading
Imports System.ComponentModel[code].......

View 1 Replies


ADVERTISEMENT

Use A DB Queue To Make Http Calls And Update Status In Db?

Feb 28, 2012

I want to use a database table as a a queue...but the processing of these messages cannot be done from the database.I have a table that stores the requests i get from a .Net component. I now have to read the data from these tables and make http calls to 2 webservices. Based on the response received from the webservices, the data gets archived or deleted.I had a few specific questions:

1. How do i make sure that if i pick a record for processing and the http call fails I should be able to go on to the next record, and then come back to this record at the end of the run

2. Is there an alternative to using the database as a queue(like MSMQ etc.), which option is better

3. I want to maintain an audit trail of the record status. Is creating a trigger to log the changes before the edit the best way to do it?

View 1 Replies

Update Sharepoint List From Winform

Mar 21, 2012

I'd like to write an app that would allow users to modify existing records in a WSS sharepoint list and/or create new records.I feel confident that its possible, but I just don't know exactly how. Sharepoint access, for me, is accessed with domain credentials, so I"d need some method for getting those from the user, in the winform, and passing those along to the WSS server.

View 1 Replies

Batch Update WinForm Program 2010?

Apr 18, 2011

Is there any method to do batch update winForm in VB 2010

Using Microsoft Access2007 as database, VB 2010 WinForm (DataGridview + Textbox)

There are a lot of record need to be Updated, It is very efficient if that data is just going through Batch Update, meaning just one click will update all the data rather than click one by one.

Any Demo or code showing how to do this Batch Update (VB.net).

View 3 Replies

Win32 API - Equivalent To Making System Calls Abd And Library Calls In UNIX?

May 8, 2010

What the Win32 API is? I have looked around but no where really outlines what it is. Is it basically a set of procedures, outlined by Microsoft for programmers in order to get services from the operating system? In essence is it the equivalent to making system calls abd and library calls in UNIX? And yes I now Windows makes library calls too.

View 2 Replies

.net - Update Statement Updates 0 Rows Via The C# Winform Application?

May 29, 2010

I'm trying to update a row via c# winform application. The update query generated from the application is formatted correctly. I tested it in the sql server environment, it worked well. When i run it from the application i get 0 rows updated.Here is the snippet that generates the update statement using reflection - don't try to figure it out. Carry on reading after the code portion:

public void Update(int cusID)
{
SqlCommand objSqlCommand = new SqlCommand();
Customer cust = new Customer();

[code]....

The above final update statement works on the sql environment, but when running via the application, the execute non query runs ok and gets 0 rows updated!

View 2 Replies

Winform Application Based On BackgroundWorker Thread Concept / UI Update

Jan 26, 2012

I have build a VB.Net windows application which does uploads data into database and basically updates two controls:

1. A textbox which is constantly updated with one line per database record upload.

2. A label which keeps track of the count of database record uploaded.

I have used BackgroundWorker thread concept, where the thread's bgwWorker_DoWork() method contains the business logic for upload and bgwWorker_ ProgressChanged() updates the 2 UI controls based on uploads.But the issue I am facing is that I do not get complete updates on both the UI controls. Sometimes the thread bypasses update of textbox and sometimes of label. I could resolve this issue by adding System.Threading.Thread.Sleep(25) before each UI control update code.[code]

View 2 Replies

Replacing DbTransaction Calls With Calls To TransactionScope?

Mar 4, 2010

I have been using DBTransaction for my current projects that access a single database. However, I read some documentation on TransactionScope and was wondering in which scenario would using TransactionScope be better? Or should I be replacing DbTransaction calls with calls to TransactionScope?

View 2 Replies

Passing Value From One Winform To Another Winform?

Jul 7, 2010

A Form is to Accept User Name and Password from user, after verification the form should display another form that will accept user's full data. When a user press the Ok button, the information entered on this form should be display in another form (Showing the user what he/she has entered)

i have Design the Firs Form and the second form, how can i pass the information entered on the second form to third, and also what will the code look like I need help on this or Code Sample?

NB: i am trying create an instance of the second form in the third form and declare a variable in the third form that will holed the value, but still not working I want to learn .NET Programming in VC#, ASP.NET And VB.NET. I am student and really get excited when it comes to programming

View 4 Replies

Asp.net - Where Contains From Two Function Calls?

Jan 12, 2012

I want to get a list of all students who were at one of two events. Here's my function to get an attendance list:

Private Function AttendanceList(ByVal Mode As AttendanceListLookupMode, ByVal AttendaceTypeID As Integer, ByVal EventID As Integer, ByVal EventOccurenceDate As Date) As IEnumerable(Of Integer)
'Get the attendance table for specified event[code].......

View 1 Replies

Use API Calls In 2008?

Nov 21, 2009

i want to know how to use api calls in vb.net2008. in visual basic 6.0. we can find the list of api calls in add in manager . in vb.net2008 how to find it..

View 2 Replies

Why Does App On Startup Calls Csc.exe

Jun 16, 2010

For some time ago I have notice that my App on every start make a call to csc.exe and starts it. I have google-it and found out that csc.exe is some kind off on-the-fly compiler for C# (If I understand it correctly ) but my App is in VB.net. VB.Net code to make my App on every start calls csc.exe?

View 13 Replies

.net - Preserve Objects Between Wcf Calls?

Dec 13, 2010

This should be fairly basic, but say I have a Public property as local variable on my WCF service, and I set this in one call to the service. Is there a way to preserve that data for another call to the service? (Without writing the data to xml or a db, and re-referencing it or anything like that)

Executing the calls from the Winform:

Public Class ClientSideWinForm
Private proxy As ServiceReference.Client
Private Sub Client_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

[Code]....

View 2 Replies

Allow Calls From Unmanaged Code?

May 5, 2009

I have an application which has been succesfully installed on a number of different client machines.

The problem I now have is that I have been asked to allow third party applications, possibly written in a non .net language set to plug into my application and execute some of the code. Just a handfull of properties and half a dozen methods.

Now I can wrap up these properties/methods, make them public and have them in their own project which will be part of my solution but I have no idea where to go from here.

How do I make this portion of my application accessible to a third party application written in unmanaged code ?

View 1 Replies

Can't Make Calls To Other Forums

Feb 20, 2012

Trying to make a call to another forum to chance some text boxes on it and update it. I had it working I thought but the values were not holding when I closed the box so I came up with this solution but Im getting null exceptions.[code]....

View 11 Replies

Executing COM API Calls From SQL Trigger

Apr 2, 2012

I have a CRM application that I would like to programatically post new records and updates to, based on values in other tables getting inserted or updated. Problem is because of how this CRM app was designed I cannot use straight SQL insert/update SQL commands. This is because the database has some proprietary account#/record ID generation algorithm, and also writes to a log table using some pretty cryptic looking values.

The only way to ensure the integrity of the data is to use a the COM based API they provide. How can I send calls to this API from SQL Server code, I'm guessing a CLR user defined function? Can anyone point me to such tutorial on the web?

The updates I am making MUST be in real time, that is why I need to use a trigger that calls this app's API.

View 2 Replies

Function Calls To Unmanaged DLL From VB

Jun 12, 2009

I'm having some trouble finding the syntax for making function calls to unmanaged DLLs in VB.NET. Let's just assume there's a function "Connected" in unmanaged DLL "Connector.DLL". I want to call this function by creating an abstract function call to it.

I've seen some code out there that looks something like
[DllImport("Connector.DLL")]
Public Shared Function Connect(ByVal intPort)
But that syntax doesn't work for me.

View 2 Replies

Main App That Calls A Dll With A Form In It?

Mar 3, 2012

I have my main app that calls a dll with a form in it. Is there a way to make my main app be the owner to the dll form?

View 7 Replies

Make Login And Using Calls VB?

Jan 28, 2010

Once I click Sign in, I want the application to test to see if the user has internet. If it does I want it to call another sub. If the network is not available I want a message to come up and say Error, no internet connection.

This is what I tried but can get it to work If My.Computer.Network.IsAvailable Then Call testnet()
else Messagebox.show("Error", "Truoble connecting to data base")

View 2 Replies

Make Pc To Phone Calls?

Jan 11, 2009

i wanna make a program with vb that can make pc to phone calls and i wanna know if it is possible with vb or if i need another program because im new to this programing thing

i added a tool in toolbox called phonecall but however i cant use it i dont know why

View 6 Replies

Multithreading Or Delegates With WMI Calls?

Jul 12, 2011

I have a VBNET app to scan my Active Directory using WMI calls and return some basic informaiton such as Dell Model name, current user logged on, Dell Service Tag etc my issue is the app becomes unresponsive whilst it scans and i have to wait for it to finish looping before i can work with it, in the past a do events used to suffice

I think Multithreading is the way i may need to go, whats the best approach? I tried to use Delegates but it doesnt seem to have made any difference

below is my for next loop code that calls the functions, the last section "Private Sub Button1_Click" down is the Delegate code i attempted

[Code]...

View 3 Replies

Php - Run Some Calls To A Site As Test?

Mar 30, 2011

I need to run different consecutive calls to a web service with no particular response needed to be read, just need execution.What is the simplest approach? I can run either asp.net or php script.

[URL]

View 2 Replies

Set Up For Multiple Calls Of Same Method?

Jun 24, 2012

I have problem setting up the mock to fail if the user has attempted to log in three time with failure. My code looks like this[code]...

View 2 Replies

VS 2010 Messed Up Api Calls?

Jun 23, 2010

i recently upgraded from vs2k8 to vs2k10 and after loading up some of my programs i couldntbut notice the error window saying "A call to PInvoke function bla bla has unbalanced the stack. bla bla bla..."This is very annoying since the exact same code worked perfectly in vs2008 and theres no apparent reason for their sudden failiure, i tried different kinds of calling conventions but i get the same error on each turn. The error message only seems to appear upon callingg

View 4 Replies

.net - Control.Invoke Never Calls Delegate?

Oct 1, 2009

I'm working with the DevExpress XtraGrid control.I have a routine that goes thru and adds all the controls on the current form dynamically, and launches on a seperate thread the routine for a given control to initialize it to the value that will be displayed to the end-user. Some of the controls are displaying calculated values, and take some time to return their values, so that's why we are doing it on a seperate thread.

[Code]...

I'm using a similar snippet of code for any control properties that have to be updated, and all work fine. On the above code when the actual Invoke is called, it APPEARS that the thread just ends and never calls the delegate, and doesn't return to finish either.

View 2 Replies

Clean Up App And Deal With The Async Calls?

Mar 16, 2010

My app is basically talking to a device via RS232. I need to 'listen' to the data received and do certain things based on it, update labels, etc. When I started, I only had a couple cross-thread calls and I used JMC's example to get by that. Now my app is bigger and I am calling the ThreadProcSafe all the time. I am hoping there is an easier way so I don't have to create sub routines for every control. Here's the relevant parts of my code.

Private Sub StepperSerialPort_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles StepperSerialPort.DataReceived
Dim ReceiveBuffer As String

[Code].....

View 4 Replies

Convert Legacy VB6 Function Calls To .NET

Jan 8, 2010

I am looking for a utility/tool to convert calls to legacy VB6 functions to the .NET equivalent. For example, it would convert this...

[Code]....

Does anybody know of one, or am I going to have to roll my own?

View 3 Replies

Creating A Function That Calls Sql Storedprocedure?

May 27, 2011

I tried to search forum topics to find a tutorial that will guide me on how to achieve this however seem like most of the tutorials i were finding were confusing me more.With that being said here is what i have,Here is what I am trying to do [URL]that tutorial is exactly what I am trying to achieve however I do not understand what the supplierstableadpater, northwindtableadapters are. I can only assume that I am not doing exactly the same thing as that tutorial.

What I have is a simple sql storedprocedure that selects all employeedetails.And also another sql stored procedure that selects just a few columns from the employees table. On my frist page I am going to list all the employee names in a gridview and when they click the employee name it should take them to another page and show that employee's details. Seems like you have to use an object datasource to achieve this but is there an easier way to achieve creating a class that calls the 2 stored procedures that I have that i would be able to then link them with an objectdatsource?

View 1 Replies

Creating Button That Calls Bat/vbs Along With Progress Bar?

Jun 23, 2010

Hey everyone I need some help, I created a bat/vbs (created two just incase) file that takes images that users have scan and re-names them places them into differnet folder and zips them so they can be uploaded that night.

When the user done scanning they click on that bat/vbs i created so it can do everything i stated above just it just opens a dos propmt or nothing happins to viewers eyes..

I want to create something in Visual Studio that calls that bat/vbs and shows them a progress bar so they know how long its going to take instead of them looking at a black DOS promptI do have visual studio 2010 and i am not really know to much about programming i start reading some books but im still a noob =)
Dominick

View 1 Replies

Error Handling Procedure Calls?

Oct 14, 2009

I have an issue with handling errors in procedure calls in VB6.

View 6 Replies







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