Slow Loop Performance While Updating Data?

Jun 8, 2012

In my winform application, I have 2 datatables, both contains 37000 rows. Table 1 has 171 columns and Table 2 has 4 columns. A While loop runs to update values in Table 1 from Table 2 for 4 columns. A For loop runs inside While twice to update values. It takes more than 5 min to do so. which i think should be a task of 5 seconds.

Columns being updated are:
Int64 - 1 Columns
String - 1 Columns

[Code]....

View 2 Replies


ADVERTISEMENT

Loop Through Dataset.Datatable Slow Performance In .Net 1.1?

Mar 16, 2009

I have a program in where I need to loop though the entire dataset.datatable. I takes a long time. What is the alternative I can use to do the some job but faster?

View 4 Replies

Slow Performance With Checkbox Datagrid?

Apr 21, 2011

I've got a DataGridView control that is bound to a datatable. The first cell of each row in the DataGrid is a checkbox. When the screen loads all of the checkboxes are unchecked by default. I have a "Select All" button to check all of the boxes. This is performing very slowly when I have a large number of rows in the grid. If I have 1,000 rows it takes over 30 seconds for them all to be checked. When I had 5,000 rows I gave up after 5+ minutes with no result. To check all of the boxes I am looping through each row of the datatable and setting the first item to True:

[code]...

Since that yielded such slow results I changed the logic to loop through each row of the datagrid and set the cell to True but that took three times as long.
Is there a way to quickly "check all" on a large set of data?

View 1 Replies

Slow IDE Performance - Esp. Selecting Image For Button?

Aug 6, 2010

while using VS 2008 SP1 for VB WinForm apps (on Win 7 Ultimate machine),I find that while the performance of VS 2008 is on the slow side, it is generally tolerable except for one thing: when selecting an image for a button, the "Select Resource" dialog will come up, and I choose "local resource", then Import. After navigating to the appropriate folder and selecting the desired image,I will almost always get the "hourglass" (now the blue whirly thing),and only after several seconds will the operation complete(i.e. the "Select Resource" dialog will show the image I selected,and then I can close it and be on my merry way). Typically while the whirly thing is going, the dialog box title will say "Select Resource (Not Responding)". Also on some occasions during the wait period, the Select Resource dialog will hide, and I will have to click the VS icon in the taskbar to make it reappear so the operation can complete.

View 8 Replies

VS 2005 Slow Performance With Backend Ms Access?

Apr 2, 2009

I have built an application using VB 2005 express edition with backend Ms Access 2000. In main form(which is loaded on startup), I am having 9 datagridviews, each bound with databindingsources. I am refreshing this data every 15 seconds by refilling the table adapters and updating the datagridviews.Now, this access database is shared in the network and is accessed by about 5-6 users concurrently. There are other forms which are used to edit the data.My problem is poor performance of the application. Its very slow in opening up forms, not responding sometimes and using the network resources fully.

View 5 Replies

IDE :: Datagridview Performance Slow Increment And Decrement In Column?

Dec 18, 2009

i have a datagridview which have 3 columns, two button columns increase or decrease, 3rd displays the value increased or decreased from button. i have datagridview_CellContentClik behind button columns. The problem is increase in value on pressing button is very slow. i mean if i press button quickly the value should increase quickly but its the same slow pace for increasing or decreasing value on pressing button.

View 2 Replies

Performance :: SLOW Compile Time - No Disk Or CPU Activity?

Aug 12, 2009

We have a project for a client that is written in VB.NET. In one of the projects, we have about 100 modules, which are all VERY simple. They're extension methods that convert between object types. Here is a small snippet:

Public Module ScheduleExtensions
<System.Runtime.CompilerServices.Extension()> _
Public Function ToServicesData(ByVal source As Schedule) As ScheduleServicesData

[code].....

View 2 Replies

Updating Excel In A Loop Does Not Update New Data?

Apr 10, 2012

I am working on trying to update a list of items to an Excel spreadsheet. I have created my own custom class called Songs and a List(Of Songs) that I want to update the spreadsheet with. It seems like everything is working -- I have even put in a debug msgbox that displays what Song it is currently on while iterating thru the loop -- but after the code iscomplete, I check the spreadsheet and only the first song in the list gets updated. I'm thinking it must have something to do with either the connection string or the parameters that prevents it from updating any other song records. BTW, there is no errors being tossed so it ats like it everything is being processed, just that the data doesn't change for the update inside the loop. Here is the section of

Private Sub btnProcessList_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProcessList.Click
Dim adoConn As New Ole.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;data source='" & _

[code].....

View 3 Replies

.net - Slow Performance When Utilizing Interop.DSOFile To Search Files By Custom Document Property?

Apr 19, 2010

I am new to the world of VB.NET and have been tasked to put together a little program to search a directory of about 2000 Excel spreadsheets and put together a list to display based on the value of a Custom Document Property within that spreadsheet file. Given that I am far from a computer programmer by education or trade, this has been an adventure.

I've gotten it to work, the results are fine. The problem is, it takes well over a minute to run. It is being run over a LAN connection. When I run it locally (using a 'test' directory of about 300 files) it executes in about 4 seconds.I'm not sure even what to expect as a reasonable execution speed, so I thought I would ask here.The code is below, if anyone thinks changes there might be of use in speeding things up.

Private Sub listByPt()
Dim di As New IO.DirectoryInfo(dir_loc)
Dim aryFiles As IO.FileInfo() = di.GetFiles("*" & ext_to_check)[code]....

View 1 Replies

Performance Of Function Using For Next Loop

Jul 12, 2011

I am calculating the average of an array(double) using a known (smaller) array of integers, which contains the indices for the larger array to give the values for the average. Below is the function:

'
'NumLoops = Ubound(LookupList)+1 !
' i always >0
Function Mean(ByRef Y() As Double, ByRef LookupList() As Integer, ByVal NumLoops As Integer) As Double
Dim res As Double
[Code] .....

Stand alone performance (through a win32 project) form is very good for my project. e.g. a Y() = 50000 entries, LookupList=1000 entries, calculating the mean 1000 times take about 5 ms.

That beats a c++ function accessed through a rcw quite easily (takes >300ms). However, when I plumb this function into a larger project the performance drops off significantly, taking (typically) 50ms for the same test. Also if (say) I make Y bigger (say, 100 000 elements) with everything else the same I see a tiny overhead in the stand alone test (of order 1 ms), yet I see a close to linear increase in the calculation time in the larger project. The larger project is not so big (a few MB) as to make we worry about resource constraints.

View 5 Replies

While Loop Causes The App To Go Slow?

Jan 8, 2010

I have a simple code that looks up a text file, reads the line of text, splits the string by semi-colons and then posts the results.

After it has done this, I have created a really simple while loop to waste 10 seconds before going for it again.... here is the code:

Private Sub checkTemps()
While Abort = False
Try

[Code]....

View 2 Replies

VB Express 2008 -> Access 2007 Updating Items Slow?

Jun 12, 2011

I'm using Visual Basic Express 2008 to create an interface with a order database in MS Access 2007 (.accdb file). Everything is fully functional except updating the "Inventory" table is very slow. Updating around 2200 items takes almost 2 minutes and the window will appear as "not responding" for the duration if you click away and come back. Here is the process:1. Tab-delimited text file is picked by user, which includes all inventory items (not just new ones)2. Each line from text is parsed and read into variables (tempSKU, tempItemTitle, etc.)3. Old items are updated and new ones are added. -> This is the bottleneck

I used to have a series of IF statements to check which elements were changed and report them, but that was about 2x as slow. The new code is a little faster but doesn't provide the feedback I liked (update part is commented around):

Private Sub btnImportInv_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) andles btnImportInv.Click
Dim strName As String

[code]....

View 3 Replies

Setup Timer To Slow Down For/Next Loop?

Jun 20, 2009

I have a For/Next Loop that adds values to column in a DataGridView. I want to set up a timer to slow the For/NExt Loop down. So the DGV will load and then the user will click button on the form and the DGV will have numbers added into all the rows of a specific column. For simplicity, assume I want to load the numbers 1-100 into each cell and I want to see each number as its passed.

I am not sure how t set up the time to work with the For/Next Loop in the Button1_Click event. Do I have to use a Timer1_Tick event as well and somehow associate it with Button1_Click event?

Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

[Code].....

View 9 Replies

Sql Server Loop Running VERY Slow

Apr 20, 2011

1. load gridview from an uploaded excel file (this would probably be about 300 records or so)

2. compare manufacturer, model and serial No to my MS SQL database (about 20K records) to see if there is a match.[code]is there a better way to find a match between the two?

View 3 Replies

Loop Through Dataset Updating Data From Results Of Another Dataset

Jun 22, 2010

I have two Datagrids, One grid has all the customers garments on it with style number and contact length. The other grid has the users who have garment issued to them. the style number is in both grids. I need to loop through the users grid and say if the contract number is 1 from the first grid then the contract date on the second grid will be todays date + 365 days (year contract) I have looked at using a stored procedure and also a for each command but I am just getting stuck with it all. [Code]

View 1 Replies

Each Loop With DataRow And DataRowCollection But It Gives Output Very Slow?

Jan 4, 2010

I fill data in C1FLEXGRID from DataTable using for...each loop with DataRow and DataRowCollection but it gives output very slow. How can I solve it.

View 1 Replies

VS 2008 : Updating An Arraylist Using A For Each Loop?

Oct 13, 2011

I can do this with a for loop, but I was just curious if an arraylist can be updated using a for each loop. ie

For Each arrItem As String In myArrayList
arrItem = "My Stuff"
Next

If I loop through the arraylist again the values remain unchanged.

View 4 Replies

VS 2008 Picturebox Not Updating In For Loop?

May 11, 2010

I am trying to make a for loop in which a picturebox is suppose to go up and then down. The problem I am having is that the picturebox is not animated; i.e, it does not update the image rather the image stays the same as from the start.

I am using timers to animate the picturebox and I have done something similar to:

For count = 1 to 8Select Case countCase 1tmrJump1.Enabled = TrueCase 2tmrJump2.Enabled = TrueAnd so forthEnd SelectNext

View 5 Replies

Textbox Text Not Updating While For Each Loop Running?

Mar 8, 2012

Windows Forms, VB application... Forgive me in advance for this very elementary question but I am overlooking something really simple here. I would like to have a label show the current value of a variable as the for each loop runs.. I created a very simple Button Click event to figure out where its failing. As it is right now the value does not display until after the for each loop finishes running, which it should actually display the counter value each time it runs through... I know this is possible and really simple because I did it years back but for the life of me cant figure out why I am missing the bar as it should constantly update the label to reflect that?Test Sub is as follows:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim counter As Integer = 0
For x As Integer = 1 To 200000

[code]....

View 2 Replies

Get 64-bit Performance Data?

May 4, 2011

[URL]

The upper picture is the output of a Unix task. The lower picture is what I have in VB. Enumerating tasks is not difficult however the rest it is because it's not documented anywhere.

What am I interested in if I want to get 64-bit performance data?

View 1 Replies

Values Not Updating Correctly In Database After Being Operated On In A Loop

Mar 18, 2011

I have the following code:

[Code]...

The problem I'm facing is that the update happens correctly only for the first of many values. All the other values are calculated and consequently, updated incorrectly in my table. I am almost certain that the looping is what is causing the problem but have been unable to find a way around it.

View 2 Replies

Loop, Timer - Code That Checks That The Network Is Connected But Need It To Keep Checking And Updating

Feb 4, 2010

I am a new member that has just start coding. Im currently working on a small application for a desktop that will give me information from my system. I have code that works but might not be great. I have code that checks that the network is connected but need it to keep checking and updating. I Have tryed loops, goto and timers but not having any luck. Can anyone help point me in right direction. Here is my code so far.

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = TimeOfDay
Label8.Text = "Time :"

[CODE].........................

View 2 Replies

Slow Animation Of A Lot Of Data?

Jul 28, 2011

I have an issue here which I am looking for ideas on. I am creating a program that models the movement of some atoms and then animates them using the basic Paint method in visual basic. The animation is to have basic remote control functions, such as play, pause, fast forward, rewind and skip to any particular frame.The program is in two parts. The program models the movements of atoms in a background thread. This program was 90% written by other people and is very long and complicated, so in your answers please do not suggest I change the modelling aspect because it's just not possible. It is my job to do the animation.

The modelling program outputs the positions of each atom (just an x,y coordinate) at each time step. We could easily be looking at 200,000 time steps and 50/100 atoms. That means there are 200,000 * 100 * 2 = 40,000,000 numbers that need to be stored. The locations are all single precision numbers.

View 39 Replies

Performance Optimization For Retrieving Xml Table Data?

Mar 17, 2012

I have written a code which does the thing as the title says. The problem is, the whole process took 10 minutes just for 1000 records. Here is the code:(Written in vb.net 3.5 and sql server ce)

MyConnection.Open()
Dim count As UInt32
cmnd = New SqlCeCommand(sqlstring, MyConnection)

[Code].....

View 1 Replies

IDE :: Data Sources Window Very Slow?

Feb 10, 2010

I'm developing a windows forms app, just upgraded it to use .NET 4.I'm VS 2010 ultimate RC.I'm running it in a virtual PC with 2GB of memory allocated to the virtual PC. I have windows 7 32 bit inside the VPC.I'm running win 7 64 bit with 4 GB at the host OS.Have a business DLL with about 300 of typed data tables.NOTE: The data tables are not in DataSets, we have generated the code for the DataTables using our own code generation mechanism.The data tables have been added as an data source (Of type Object)I'm running VS 2008 in my main OS. (Not a VPC)When running VS 2008 it takes 30 seconds to open the Data Sources window, the first time I open it.About 15 seconds subsequent times.Also when on a form and setting a binding expression it takes 10 seconds before the drop down list of available object to bind to comes up.

I have quite a powerful PC (5 experience score) relative to other developers at my company.This performance is a very serious productivity issue and makes developing windows forms apps very tedious.As a result of this VS 2008 is not very popular.The exact same slow performance seems to still exist with VS 2010. (Similar times)It could be the VPC but I don't have a machine to test this on and I don't want to put the RC on main main development machine.Did you expect a lot less than 300 data sources? 300 seems quite low to me for any real workd business application.

View 4 Replies

Load Data Into Datagridview Is Very Slow

May 10, 2011

I am loading data from query into a dataadapter and then into a dataset.the datadridview datasource is the set to the dataset.but it takes too long to load the data into the datagridview.

View 2 Replies

Save Data In Ms Access Is Too Slow

May 2, 2012

I save Data in MS Access Is too slow. I click Save button [Saved Msgbox appear] then I see the table there is no changes, after 5-6 second it take effects. The code is....

[Code]...

View 7 Replies

Improve The Performance Of Reading Data From Excel And Writing To Datatable?

May 21, 2011

I want to import data from excel and move that to Datatable in VB.NET 2008. I wrote and working but its taking too long time.. for 1500 records its taking 4.40 min.

[Code]...

View 1 Replies

Performance Concerns Between DataTable And SqlDataReader To Fill Data With FlexGrid

Nov 5, 2009

Which one is more faster between DataTable and SqlDataReader while I'm trying to fill Data into FlexGrid with VB.NET?

View 3 Replies

Data Terminal Device Slow Searching String In Text File?

Apr 4, 2011

Is there a way to search fast in text file? i have a 5mb text file and it is slow to search ..Im using Vs2008 (VB) and MC3100 WinCE 6 platform

Code
Private Sub DataHandler()

[code].....

View 8 Replies







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