Will The "New" Bit Only Be Executed Once When The Function Is First Executed But In The Next Call, It Will Already Exist

Sep 27, 2009

I used to write this:

Private Sub Example()
Static CachedPeople As List(Of MyApp.Person)
If CachedPeople Is Nothing Then

[code]....

But then wondered if I could reduce this to:

Private Sub Example()
Static CachedPeople As New List(Of MyApp.Person)
...rest of code...
End Sub

will the "New" bit only be executed once when the function is first executed but in the next call, it will already exist.

View 1 Replies


ADVERTISEMENT

ACCESS SQL: Nz() Function Executed From VBD?

Apr 8, 2012

Possible Duplicate: Convert Null to zero in access databaseI'm using Microsoft Visual Web Developer 2010 Express to create ASP/VB.NET page to connect with a Microsoft office Access 07. Here's my issue:

View 2 Replies

Programatically Reveal The Name Of The Current Function Or Sub Being Executed?

Apr 2, 2009

How can I programatically reveal the name of the current function or sub being executed? How can I programatically determine when a usercontrol is in focus. I've been using the .Paint peramiter and while this works, I think there has to be a better way.

View 2 Replies

Transaction Error On Call To Commit() When Select Has Been Executed Inside Transaction?

May 9, 2011

I get this error at the Commit of a transaction in a desktop application:

This OleDbTransaction has completed; it is no longer usable.

Other posts I have seen with similar error suggests this can occur if it takes a long time, or contains large amounts of data. This is not the case here.Logging tells me it takes 140 ms from Begin to Commit and about 10 commands executed inside the transaction.It is using an Oracle database.This class is a simplified version of my database class:

Class MyDatabase
Private mConnection AS OleDbConnection
Private mTransaction AS OleDbTransaction

[code]....

Is it not allowed to run a select inside a transaction like this? Or can it be done by running the transaction in a specific isolation level (I see that the BeginTransaction method has an optional parameter for doing this) ? ..Or some other sollution..? In my case, it was not a problem to move the select to run before the transaction started, but what if you need to run selects that must run inside the transaction?

View 1 Replies

VB2008 Reload A Form Of The Running Application From One Computer When Executed A Function From Other Computer With The Same Application?

Mar 15, 2012

Is it possible to reload a form of the running application from one computer when I executed a function from my other computer with the same application? co'z I want to see the changes of data on my datagrid view?

View 2 Replies

Code Is Not Being Executed

Jul 4, 2012

My problem is that some code I enter will not be executed. Here is an example of my Form Load event. If i debug the code then the first two lines are executed. The MsgBox won't be executed though. or anything else after it. My programm does run perfectly. But i cant make any changes anymore It's driving me nuts, I don't have the faintest Idea what could be wrong. I sent the code to a friend and he isn't having any problems at all. We both use win7 64bit (he has ultimate, i have home) [code]

View 2 Replies

Only One Form Is Getting Executed?

May 28, 2010

I am developing a window application. I'm using Visual Studio 2005 and Mysql Database. The problem is, only one form is getting executed when I try to debug.I have changed the startup form to other forms(from a list of existing forms), but still that same old form is getting executed, even if I delete that form or exclude it from the project, it still keeps on executing.

Where this form is stored?(I deleted it from the folder where all other forms exist)

View 6 Replies

What's The Value Of This Code When Executed

Mar 23, 2010

For intOuterCount = 1 to 5
For intInnerCount = 1 to 4
intTotalCount +=1
Next
Next

View 7 Replies

C# - Change Javascript Before It's Executed

Jun 15, 2012

I want to open a website, change its javascript, then show the website + execute my changed js.

1) Is this possible?

2) How is this possible? ( VB.net, C#, FF + Addons )

EDIT: To your better understanding, I just want the js to be just changed for my browser output!

View 4 Replies

Code Being Executed But Not Being Able To Debug It

Jul 30, 2009

I have a hashtable of a class that contains a timer. When this timer elapses x amount of time, it calls a subroutine within the class. This subroutine calls several other functions and subroutines and then its done until the timer elapses again. Now one of the subroutines updates a label on the form and i can see that happening when its supposed to. There is another subroutine that should be updating another label but it is not. I believe this would be a simple correction but when i set a debug point on the routine it does not work. I'm not going to post the code for this as it is hundreds of lines of code and its probably just a configuration in the IDE that got changed somehow.

I run break points around the rest of the project just fine, even in other classes that use timers. Does anyone else have this problem of code being executed but not being able to debug it?

View 5 Replies

Code To Be Executed On One Form First

Jul 26, 2010

I have a project with 2 forms. I need the code to be executed on one form first, which is why it is run first, then I want to hide it and just display the user interface form. I have the following code, it makes both forms appear, but I only want the user display form to show: [code] I call both these subs in the frmLoad of the Processing form.

View 3 Replies

How Many Times Is The Loop Executed

May 6, 2009

i = 5, j = 15
do while (i<j)
i=i+1
j=j-1
end while

how many times is the loop executed? is this 4?

final value of i? 9?
final value of j? 10?

when would you do a do while versus a for next loop?if the upperbound of a one dimensional array is 10, what is the size of the array? 11?CAN I GET HELP WITH THIS

dim x(20,2), y(20,2) as integer
dim i as integer
for i = 4 to 12 step 4

[code]....

how many times is the loop executed? 3?what is the value of i after the code is executed?if x and y are dimensioned as dim x(10),y(10,2) as integer, what would happen in the code?

View 9 Replies

VS 2008 How To Hide An Executed Exe

Dec 29, 2010

Basically i know this sounds like its malicious but its not

Im trying to create a GUI for a console application but everytime a process is carried out the CMD window appears directly over then application.

Process.Start(fnvLocation.Text, "push " & recDir.Text & "Data.zip /data/local/rmo.zip")

View 5 Replies

Do All ElseIf Get Executed After One Has Been Found True

Jan 14, 2010

Assume I have an If-ElseIf decision to make. Do all ElseIf's get executed after one has been found true? [Code] Obviously that is not a real subroutine but I wrote that just to clarify what I'm asking. When this is run, on the second ElseIf the value is equal to 5 so whatever is inside that ElseIf would execute. Once that happens do the following ElseIf's get checked or does the program immediately go to the End If?

View 5 Replies

Ensure That Statements Are Executed In Order?

Mar 10, 2011

I have the following code which is part of a PA Call system: The 'SetPTT' nd 'DisableZones' statements set controls on the form where the code is. The LAPG2Coms.SetZones command starts another project within the solution to control an external controller. What I can't understand is why it executes the LAPG2 statement before SetPTT or DisableZones. The LAPG2 statement for messages is in the PlayMessage Procedure

[Code]...

View 12 Replies

Form Load Not Fully Executed?

Apr 25, 2010

i got this window is in an mdi form and the form_load event is not fully executed, im on window 7 x64 VB 2008. Here is the code of the form load event
Private Sub frmGestion_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

bd.connexion("TacoBD.mdb") bd.ChargerDataset("tblModelAutoLuxe", "SELECT * FROM tblModelAutoLuxe") For ctr As Integer = 0 To bd.dsTaco.Tables(0).Rows.Count - 1 lstVehiculesLuxe.Items.Add(bd.dsTaco.Tables(0).Rows(ctr).Item(0)) Next bd.ChargerMarques("tblModelAuto") bd.Deconnexion() For ctr As Integer = 0 To bd.dsMarques.Tables(0).Rows.Count - 1

[Code]...

View 1 Replies

Get Combobox SelectedIndexChanged Be Executed On Load?

Jul 5, 2006

What is the method to not allow combobox SelectedIndexChanged to be executed on load. and only make it to be executed when a "USER" changes the selection value.

View 1 Replies

Loops - How Many Times Is The Loop Executed

May 6, 2009

[Code]...

how many times is the loop executed? what is the value of i after the code is executed? if x and y are dimensioned as dim x(10),y(10,2) as integer, what would happen in the code? what would happen in the code if the first statement was for i = 14 to 12 step 4?

View 2 Replies

Methods Are Executed When A Form Closed?

Apr 21, 2009

I want to add some action to my form when it is closed by clicking on the "X" button in the upper right corner of the form.How is this done? I suspect that i must add a handler for some event, but which event is it?

Currently i am using the closing event, but i dont get it to work properly.

View 10 Replies

Record All Lines Of Code Being Executed?

Aug 15, 2011

I have a form that on load keeps closing without any errors... I have no clue what it wrong with it. How can I record all the lines of code being executed so that I can find out why it is closing. There are no errors or me.closes.

View 3 Replies

SQL Query : What If Two Queries Were Executed At The Same Time

Jun 18, 2012

Sample Table
Job_ID Job_Name Status
1 TEST00001 FOR KE
2 TEST00002 FOR KE

[code]....

I have sql query that will get a jobname where status is equal to 'FOR KE' and I have multiple users that will query that.Now, what if two queries was executed at the same time? Will the two users get the same jobname? How can I avoid that?

View 15 Replies

VS 2010 Deleted Code Still Executed?

Nov 19, 2010

does anyone know how to solve this kind of issue?if i add code to an existing code in my control/function/subroutine it will not executed and also if i delete some existing code in my program the code is still executed even though i delete it..

View 5 Replies

Why Does The MyClass1 New() Method (no Args) Get Executed

Aug 9, 2011

I'm creating an inherited class like this:

Public Class MyClass1
Public Sub New()
MsgBox("No Args")

[Code].....

Why does the MyClass1 new() method (no args) get executed when I am instantiating the zzz class and passing in a string ?

View 3 Replies

WPF - Can Multiple CommandBindings Be Executed For The Same Command?

Jan 8, 2011

In WPF I'm trying to use commands to set all the content in multiple textboxes at once. The following code is able to get a command on the toggle button to execute for which ever textbox has scope but I can't seem to get the command to execute for both at the same time.

[code]...

Is what I am trying to do possible with commands? I would prefer not having to make direct references to each textbox in code behind inside a click_event or anything like.

View 3 Replies

WPF .net - Multiple CommandBindings Be Executed For The Same Command?

Jul 25, 2011

In WPF I'm trying to use commands to set all the content in multiple textboxes at once. The following code is able to get a command on the toggle button to execute for which ever textbox has scope but I can't seem to get the command to execute for both at the same time.

[Code]...

View 1 Replies

.net - Exception Handling: Is Finally Executed After Throw?

Oct 16, 2009

Assume you have the following code:

Instead of doing:
Try
'
[code].....

View 5 Replies

App In Wn7 - COM Object Gets Executed Fine But Never Shows Up On The Screen

Sep 28, 2011

I am a recent newcomer to VB.net, having moved from VB6 this summer. I am using VS2008 because I also need to develop for WM6 on a ruggged pocket pc. I am not a commercial developer. I only develop apps for my own use, so I can live with some things that I could never survive with on a commercial basis. I developed an app that automates a COM object on my 32 bit WinXP machine. The app runs as expected, whether from the VS2008 IDE or from the executable in the bindebug directory where the supporting files are located. When I installed VS2008 on my new laptop, a 64 bit Win7 Home Premium system, the app still runs fine from the IDE but not from the exe file in bindebug. The problem is that the COM object gets executed fine, but never shows up on the screen.

[Code]...

View 4 Replies

Appdomain.unhandled Exception Event Is Not Always Executed

Jan 5, 2011

I have a service application that randomly stops without any errors in my log or in the event application log. I believe that there could be an unhandled exception somewhere in the code so I set up the AppDomain.Unhandled event to catch any exceptions. While trying to induce unhandled exceptions I have found that this event is not always fired. I added the following code to my service's Shared Sub Main method (but I orginally had it in the OnStart method and was seeing mostly the same thing)

Dim currentDomain as AppDomain = AppDomain.CurrentDomain
Add Handler currentDomain.UnhandledException, Address of MyHandler

View 7 Replies

Form Is Partially Executed Before Form_Load Event

Jul 9, 2009

I have a problem concerning the Form_Loading event: When I want to load a new Form (ImageDisplay) the ImageDisplay_Load Event is not executed first.

Instead it runs through the global variables definitions and then executes a Private Sub called numericupdown1_changed.

The numericupdown1 field is part of the form I want to load and has not been touched.

That is my calling sequence:

Private Sub Dispalydata_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dispalydata.Click
Dim myDisplay As New ImageDisplay

[Code]...

The strange thing is that for other forms in my code it works well and starts with the form_load function.

View 10 Replies

Generate Next Number - Search Executed On Click

Sep 2, 2009

I am using following format of CustomerNumber
CurrentDate + SerialNumber
So the flow of Numbers for the month of August is as under:
010809+01 = 1080901
010809+02 = 1080902
010809+03 = 1080903
and upto
310809+01 = 31080901

The flow of program is that onClick of a button GenNextNumber a search is executed and the highest number in the table is shown in a Messagebox and on OK the nextnumber is displayed in CustomerNumberTextBox by adding 1 to the last highext number. The programme is running fine for one month. The problem I am facing at the start of next month. At the start of Month September the first number will be
010909+01 = 1090901

Now when I try to generat next number the highest number is shown as 31080901 :
Obviously because 31080901 > 1090901
But i want that the next number should be
010909+02 = 1090902
Should I change the Date format as MMddYY so that it will display the highest number with reference to highest month.

View 6 Replies







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