Code - Runs Too Slow ?

Jun 5, 2011

I've got a vb.net 2005 form that calls a stored proc to load a combobox with eligible sales reps. There are approximately 40k sales reps available...I know that's a lot, but that's what I'm dealing with. I'm trying to figure out why it's taking this form 15 seconds to load.

Here's my code:

Want to load this in the most efficient way possible given the HUGE amount of data that my client is wanting to see.

Can you help me? :confused:

View 1 Replies


ADVERTISEMENT

App Runs Slow On Other Machines?

May 24, 2009

Basically i have designed an app that runs smoothly on my desktop PC (3GHz processor, 2GB RAM, Windows XP Media Centre (SP3)).

When i put the app on my laptop(1.4GHz processor, 448MB RAM, Windows XP Home Edition (SP2)) it runs really slow and is unusable.

I have tried deploying the app and also just copy the whole folder to my laptop and run the apps *.exe from the bin/debug folder, but it has the same results.

I have tested it on higher spec machines with 2GB RAM and they also replicate the slowness, so i'm at a loss as to why it behaves 100% on my desktop PC, where i have Visual Studio installed but not on any other machine.

My question is if little differences like operating system, RAM, service packs, VS installation, etc, make apps run differently on different machines.

View 4 Replies

Application Runs Slow

Jul 22, 2009

I have designed an application just like it is an Excel table. By changing each textbox the application runs a huge amount of vb code and it takes time.

E.g. you want to enter a three digits number it takes from two to four and sometimes more seconds for ech digit to enter. That`s really embarrassing.

View 11 Replies

Graphics.DrawImage Call Runs Slow?

Jun 5, 2010

I'm trying to improve the speed of my call to:Graphics.DrawImage (Image, Rectangle, Int32, Int32, Int32, Int32, GraphicsUnit, ImageAttributes)I want to display two images, where the old one fades smoothly into the new one, driven by a Timer tick of 10 or 20 ticks a second. The following code runs fine on JPEG files of around half a megabyte or less, but takes much too long (up to half a second) fora 2MB JPEG. Using the Stopwatch control, I isolated the problem to the two .DrawImage calls. Do I need to do this in DirectX or is there a way to improve the efficiency of the routine? I thought of trying to resize the two images beforehand to fit the rectangle, but that's not a simple call (I don't think), and it might just mean moving the delay elsewhere.

(Dim fltOpacity As Single = 1.0F 'opacity value)
(Dim BGrafx As BufferedGraphics)
* * * * * * * * * *

[code].....

View 1 Replies

No Code Runs After ExecuteReader()?

Aug 3, 2011

I am using Microsoft visual basic 2010. I am using the following code to connect to a local access database. After the line myReader = cmd.ExecuteReader () no code runs. I am not receiving an error message.

Dim connectionString
As String =
"Provider=Microsoft.ACE.OLEDB.12.0;data source=C:UsersmikeDocumentsFCE_Database.mdb"

[code]....

I have used this method to connect to the same database multiple times in the same program without a problem I've also tried using OleDb with the same result.

View 20 Replies

.net - Live Code Runs In IIS And ASP.NET Web Server But Not IIS Express?

Apr 21, 2011

Having recently installed IIS Express I was hoping that it was going to make life easier for me, but I've run into a problem almost straight away.Consider the following which is representative of some live code:

Public Shared Function GetServiceId() As String
Dim principal As MyCustomAuthentication.Principal.MyPrincipal
principal = CType(Thread.CurrentPrincipal, MyCustomAuthentication.Principal.MyPrincipal)

[code]....

Running the code under the ASP.NET Web Server (Cassini) everything is fine and I can see that Thread.CurrentPrincipal is of type MyCustomAuthentication.Principal.MyPrincipal.Running under IIS Express this same line throws an InvalidCastException and checking the type I find it is now of System.Security.Principal.GenericPrincipal which is confusing as nothing else has changed.I can confirm that MyCustomAuthentication.Principal.MyPrincipal implements IPrincipal and remember this is Live code, it is currently deployed and working.

View 1 Replies

Code Runs When Debugging But Stalls In Run Mode?

Jun 15, 2011

i wrote a piece of code to write some data to a card reader, and read back from that device, filling a form with the data (after reformat).When I step through the code while debugging (using F5, F8 for stepping forward) the form is filled correctly.However, when I run the code (Ctrl-F5), the program seems to hang for about 5 sec and then throws an exception: 'Length should be >0' When looking further during debug - it seems that the program calls 2x the Sub Frm_Read_Display(). I

Imports System.Windows.Forms
Imports System
Imports System.IO.Ports
Imports System.Threading

[code]....

View 5 Replies

Xml - When Running Project, Not All Form_load Code Runs?

Mar 10, 2011

this code was just working! but for some reason it stopped to work now. when i run this project the following code is supposed to execute but it does

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim xmldoc As New System.Xml.XmlDocument()

[code]....

View 2 Replies

C# - Software (or CommandLine) That Dynamically Runs Dotnet Code?

May 4, 2012

I once heard about a software that could dynamically run dotnet instructions (C#, if I remember well) on its command line, e.g when entering 1==1, the output would be true.I don't remember the name of this soft, and sometimes one just wants to know the result of a given instruction, without having to create a new program, compiling it and run it...

I would happily take the challenge to make a soft like this on my own later, but for now on I'd just like to find this soft.Does anyone know its name, or another app which would achieve the same result? (Don't tell me PowerShell, I'm searching for something more handy.

EDIT For those who use Visual Studio and who didn't know (I just learnt about it), you can also use the Immediate Window. It even allows you to get intellisense in some cases.

View 4 Replies

IDE :: Slow Code Behind Display?

May 9, 2011

My stats:OS: XP Professional (2002) SP2Pentium 4 CPU, 3.2 Ghz, 2.98 G RAMApp: VS 2008 Pro. v 9.0.21022.8 RTM

View 3 Replies

Company App Runs Off Internet Explorer But Can't View The Source Code?

Mar 3, 2011

I'm creating some buttons in Word 2007 that I want to use in my company application to make our teams life easier. The application is a server application but when it loads it goes through our internet explorer.If I could reveal the source code then I could get the ElementbyID to hook up the button to the text field in the application.When the application loads I can quickly right click on view the source code and it is written in C#.This is one of the id's i was able to grab

id="upEnvironmentHidden" value="PRODUCTION"

How can I make it possible to view the source code of this application...also the internet explorer will dissapear and then the application is launched.

View 1 Replies

Forms :: Checks If Certain Variables Have Been Flagged And If So Runs Relevent Code?

Mar 23, 2010

I've almost completed my first VB.Net app which is a rewrite of an old vba app I wrote.The last part that I need to write is the timed events part. What I have in VBA is quite straightforward.Every 500ms the Timer event runs through, it checks if certain variables have been flagged and if so runs the relevent code? Code is nothing major, just updates a networked device.I've looked into timers in .net but it seems like there are various routes that I can go down.

View 10 Replies

IDE :: Slow Code Editing In VS 2010 Beta 1?

Jul 1, 2009

I've tried using the VS 2010 beta to edit some real projects, and it is next to unusable due to performance issues. The cpu is more or less constantly at 100%, and most often the code editor uses around 10 seconds to respond to any text input. If I introduce a couple of compile errors things get even worse. Are there some drastical performance improvements that are planned in the VB editor before release, or are there special things that might trigger this?

View 22 Replies

VS 2010 Getting Started With Linq, Code Is Very Slow?

Oct 19, 2011

I am using DataSet.ReadXml() to create a DataSet from the following XML file, so that I can quickly query it using Linq.[URL]..I then use the following object to create a DataTable which can be used as a dictionary, with a ConvertToFriendlyFormat function that takes an Emulator_Id and and a string that corresponds to a DicEntry node's StoredFormat attributed, and return the same node's FriendlyFormat attribute.

This does work BUT it is extremely slow (~11 seconds to call it ~220 times). I have been unable to figure out how create the DataSet when the object is initialised and just query the simple DataTable in the ConvertToFriendlyFormat call. I guess this is what is slowing it down?

[Code]...

View 4 Replies

VB 2008 & Debugging Simple Code Runs With Variable Assignments Left In Memory?

Sep 16, 2011

I'm running VB2008 on Windows 7; I've written out a ver simple piece of code:

Option
Explicit
On
Module

[code]....

When I run or debug the code, it asks for the First Number and then just completes the running of the program without asking for the second number and uses some random number. The console.readline() doesn't work either, the console window just disappears.

View 2 Replies

Application Slow Is DB Access/text File Code Ok?

Jan 26, 2012

I noticed that my application is running a bit slow. This is a Windows Service built using VB2010 with SQL Server as a back end. Its main function is to poll a folder looking for a text file. If found it reads the text file and imports the data into SQL Server.

While the slowness could be caused by a number of reasons, I am looking at my code to determine if it could be more efficient. Below I've pasted snippets of code where I initialize the DB connection and execute SQL statements. I've also included a snippet that illustrates how I am processing the text file.

I'd appreciate if the group could have a look at these and let me know if the method that I am using is the most efficient possible. At this time I am also focusing on other probable issues, but I can't rule out the possibility that the code that is in place might be a contributing factor.

[Code]...

View 4 Replies

Run Code When Code Runs?

Oct 2, 2009

I was wondering if there is any way to make a sub run when another bit of code has run like doing a handles event bit.The reason I want to know is that I have made a custom message box and would like to effectively create a shortcut by whereby when the string CusMsg (my chosen variable for the message box message) appears in the code and runs, it makes form3 (custom message box form) open and label 1 on that form is the writing the of the message.

View 2 Replies

VS 2008 Auto-Format Curly Brace Code Too Slow

Apr 30, 2009

I have written a quick 'algorithm' that automatically formats curly brace code in the correct way:[code]It works quite simple, it loops through all the lines and keeps track of the brace count using a counter. The counter will be incremented by 1 if it finds an opening brace, and decremented by 1 if it finds a closing brace.Then, each line is trimmed, and a total of "n" tabs is inserted before the text, where "n" is the brace count as explained above.[code]So my question basically is, how can I avoid having to do the same thing (exchanging lines) twice? I have noticed that the actual exchanging of lines is very slow, so having to do it twice for each closing brace line is simply a very bad design..

View 6 Replies

.net - Code Runs With No Errors Until The "Send Error Report To Microsoft" Comes Up

Mar 28, 2011

I have some vb.net code which should print out labels using Teklynx LabelView software (which I've had working before.)Problem is, it runs fine on Dev machine, but when I run it on the end user's PC, I don't get any error messages until it completely dies with the "Send error report to Microsoft" message.

How can I troubleshoot this???

[Code]...

View 5 Replies

No Bitmap Image Is Loaded Into Image Column Within Dataset After This Code Runs?

Nov 7, 2010

Here is the code:

'Add images column to DataTable.
ds.Tables(0).Columns.Add("Image", GetType(BitmapImage))
'Create array of image paths.
Dim currentDir As String

[code]....

View 2 Replies

Code Runs The First Time And Crashes The Second Time?

Jul 20, 2011

I have a problem and i can't find it, i'll explain on the codeThe first time it runs without errors but, the second time...lista is a ListView

Dim l As New List(Of String)
Sub LoadData(ByVal user As String)
lista.Enabled = False

[code].....

View 3 Replies

A Timer Just Runs Once?

Feb 13, 2010

I wrote an application that have two timers, one of them (timer_poll) when the ticks event i change the enable to false in order to execute a code. this code writes an information in a COM, and after recieved the information from the COM from a Funtion I change the Enable property for the timer_poll to enable again but it have neve run again.the timer_poll_tick_1 does not start again, i activate a breckpoint, I can confirm that the timer_poll.enable=true because i put a button on the application that on its click event it shows me tha properties of the timer_poll, like this:

MsgBox(
CStr(timer_poll.Interval) + "|" + CStr(timer_poll.Enabled))

here is the code of the timer_poll_tick_1

Private Sub timer_poll_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timer_poll.Tick
timer_poll.Enabled =

[code]....

View 1 Replies

App Runs On Computer But Now Others?

Apr 30, 2010

I've been working on this application for a few days now, and have had people beta testing it day by day. well last night I did a pretty big update on it, and release the beta to a few people, all with different architectures and other devices, and now it wont run on any of there computers. It begins to load, and then just closes. No errors, hanging, or overflow. the max it gets at in ram usage is 27k. No windows load either. They only thing that is a reference is the itunes sdk, which hasnt changed since I started making this app. I've checked the form load, and nothing there is causing it to end. I even commented out all the code I added last night, and still nothing.

View 11 Replies

.net Application When Close Still Runs?

Nov 29, 2011

i created an .exe application with vb.net 2010 , my problem is when i run the application and then close it, it still runs in processes . why does this happens ? and how can i fix it?

View 1 Replies

App Runs In IDE But Error From Release Exe

Oct 11, 2010

This is just a test app I'm using as a training tool.It connects to a MS Access 2007 db.It gives me no error when I run it from the IDE but when I run the exe from the in elease it gives me this error,Failed to enable constraints.One or more rows contain values violating non-null, unique, or foreign-key constraints.I've found the relation thats causing this but, the data in the tables seems to be fine.No missing Primary keys, no duplicate primary keys, there no extra foreign keys.

View 2 Replies

Application Only Runs For A Few Hours

Mar 17, 2011

I have 2 applications, 1 that goes out and grabs data every minute and inserts or updates that data depending on a time interval into sql tables, the other 1 goes out at the top of every hour and grabs hourly data. Both of these applications run perfectly fine when they are compiled and published to run on my development PC, both do xml validation and check for duplicate data prior to any sql insert so I know it's not getting SQL exceptions.

When I move them to the Production Server the 1 minute application will work for a few hours and then freeze up and stop working.The hourly application half the time won't work at all.

I've made sure to include a local copy of the references when I compile/build and publish the application. I've made sure the Production Server is up to date with the latest .Net framework.

View 1 Replies

Create App That Runs On Startup?

Apr 20, 2011

I want to create an application that once installed (this will be distributed software, so there is no point running code that injects stuff into the registry and creates the the auto startup stuff after the install) , runs on start up on windows for all users, and creates a system tray icon. The following is Visual Basic code that creates a registry key entry, is this the way to go?[code]...

View 4 Replies

Detecting When A New Process Runs?

Aug 10, 2011

How can i detect when a new process starts (Any process)?

View 13 Replies

Different Results On Subsequent Runs

Jan 6, 2012

I have made a program that minimizes a function of several variables. My question is why I keep getting diffrent results on subsequent runs? The inputs of all runs are same.

View 3 Replies

End A Process If It Runs More Then Like 10seconds?

Jan 31, 2009

i wanted to know how i can end a process if it runs more then like 10seconds. I am coding a tool that runs a Perl Script but if the Perl Script doesent work then it just hangs at 1 point so it doesent go further what i wanted to do is tell the Program to end the Process after 10 Seconds.

Dim proc As New Process
For Each names As String In lb_1.Items
With proc.StartInfo

[code]....

View 6 Replies







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