Variable Lasting Longer Than Program Runtime
Oct 26, 2009
I'm writing a simple program to "change" a login. I need to know how to create a variable that lasts past when the program is closed (so the changed login stays and is not reset). Here is my code:
[Code]...
View 11 Replies
ADVERTISEMENT
May 31, 2011
When I scroll down to the function shown below, and right click Analogues - go to definition it takes me to the top of the file, and lands on top of the
[Code]...
View 3 Replies
Feb 2, 2010
When I attempt to run a program I just finished coding I get the following message: "Error 1 Handles clause requires a WithEvents variable defined in the containing type or one of its base types." Looked it up online and still does not make sense to me. If I need to paste code or anything else let me know and I will do so ASAP.
View 8 Replies
May 26, 2011
Myself and a colleague have a program called SwiftScreen, its been out for a month now but since May 25th our program is returning an error when they fill out a form that sends us an email (through our application). My best guess is windows recently had an update of somesort but i don't know. Does anyone know a way to send mail, perferably to a gmail account, that still works using Vb.net?
Here is the email code i'm using"
Dim message As System.Net.Mail.MailMessage
Dim smtp As New System.Net.Mail.SmtpClient("smtp.gmail.com")
Dim fromMailAddress As System.Net.Mail.MailAddress
[Code]....
View 9 Replies
Apr 24, 2011
I want in my bridge program the time between appearance of cards longer. Different suggestions can be found in the forum. I tried "System.Threading.Thread.Sleep(100)" resulting in the card appearing in half and after the delay the rest. Only the following code does as intended:
Dim Timer As DateTime = Now.AddMilliseconds(2000)
Do Until (Now > Timer)
Application.DoEvents()
Loop
I place this just for the code of the next card to be displayed. It is strange that the dim statement should be there. When I place it instead at the beginning of the program the code doesn't function anymore.I can live with that, however, in the forum some contributors write that this code is dangerous as it can slow down the machine considerably..Is that true or and/or only true for older versions of Visual Basic?
View 5 Replies
Apr 17, 2010
My program used to run on my system just fine until I removed some other applications. Then the proggy was giving me a runtime error. The funny thing is that once I installed visual basic 6 and added a reference to dao360.dll, or the Microsoft DAO 3.6 that the program then worked without error.
VB6 was never installed on this system before. The program worked just fine until applications were uninstalled from the system. What happened that caused the reference to stop working? Why did the program stop finding dao360.dll even though the program itself wasn't modified since vb6 wasn't installed?
View 2 Replies
May 25, 2011
im using many variables in my project however, they are most of the time used for 1 or 2 things, so having them loaded up like that forever sounds not very good for performance.Is there a way i can remove a variable after i no longer need it?
for example:
private sub button1_click() handles button1.click
dim result as integer = var2 + var1 / 2
[code]....
View 33 Replies
Oct 6, 2010
I'm trying to populate some file dependant settings from the database. Values I can add no problem but how to set the names as they differ from datafile to datafile?
For Each myRow In SetModDataTbl.Rows
Dim SettingName As String = myRow.Item(1)
Dim SettingValue As String = myRow.Item(2)
'>> SettingName = SettingValue <<
Next myRow
View 1 Replies
May 18, 2012
Public Class Form1
Dim x, c, number(0 To 19) As Integer
Dim s As Integer
[CODE]...
The variables in the brackets [example] do not actually have brackets in them in the original code. These are where the issues are. For both variables, it says, "The type for variable [variable] will not be inferred because it is bound to a field in an enclosing scope. Either change the name of [variable], or use the fully qualified name (for example, 'Me.[variable]' or 'MyBase.[variable]')." Now, I'm not entirely sure if this is a stupid question or not, as I'm used to VB '98 because that's what we use in my programming class at High School. let me know why this won't work.
-Note: The intention of this program is to continually loop the generation of numbers for this list until I tell it to stop. Button1 ends the program, Button2 generates the list one time only, Button3 is supposed to loop the generation of the list, and Button4 is supposed to end the loop, but not the program.
View 9 Replies
Jan 15, 2011
In Visual Studio 2010 is it possible to check the state of variables during run time. When a run time error occurs the error is highlighted and you are able to mouse over different variables to see their values when the error happened. I would like to do something similar except without the error.
View 7 Replies
Oct 30, 2009
I am trying to create a number of objects depending on the width of a row of an array, is there a way I can change the name of the variable being Dim 'd as I don't know how wide the array will be.
I have been trying something along the lines of:
pseudocode
For x as integer = 0 to UBound(MyArray,2)
Dim Object & CStr(x) As Object Type
Next
View 3 Replies
Jul 16, 2009
global variable can be created during runtime?
View 1 Replies
Jan 26, 2009
I'm multiplying X*Y*Z in a loop of 200 interations Y is declared as a constant. A timer can cause the loop to pause for 10 seconds.
During this 10 sexond pause I would like to change the value of Y. It needs to be changed only for this run, not a permanent change which can be done in the declaration.
View 1 Replies
May 14, 2009
I have a third party dll. I wish to create a variable to reference to one of the variable in it.so that the value in the class change, my value also change. The senario can be reproduce from the code below.For the code below i wish to get the form to display 2 instead of 1. How can i make my variable test2 always referencing test.testValue?
View 11 Replies
Jan 23, 2012
I have a list with several fields that is created from dataset from a linqtosql query. At run-time, the user gets to specify what field he/she wants to display from the list. In other languages, I can dynamically do this like:
valueIwant=mylist(i).[fieldnameImInterestedIn]
Where 'fieldnameImInterstedIn is itself a variable. How do I do this in VB.Net?
non-working actual code follows:
Dim patientdata = (From patientvar In pdfdatacontext.tbPatients Where patientvar.PatientID = patientid)
Dim patientlist = patientdata.ToList()
fieldvalue=patientlist(0).(reportrow.userselectedfieldname)
View 1 Replies
Sep 30, 2010
Is there any way to access your variable names at runtime? Is there any kind of collection you can loop through?
View 2 Replies
Sep 29, 2011
I am trying to create new variables inside a class after creating its object at runtime. The problem is that I don't know the variable names or the value beforehand so I have to create the new variables at runtime.
[Code]...
This is a more elaborate explanation of my code. If you observe that in the Eval function I have tried to evaluate Fval(abc). Now the object array abc is not declared in the Test class because it existence is not known beforehand. What I want to do is create an object array abc of length 2 and populate it with some values and when Fval(abc) is called then then the value of index 1 should be the return value of Eval fucntion.
View 2 Replies
Jul 26, 2010
I've got some code that looks like this:
If ediFileGroupAbbr = "NIPDSINV" OrElse ediFileGroupAbbr = "WWPDSINV" Then
Dim p As New PrivateBillingAdapter_ForN(ediFileGroupAbbr, businessLocationID, mode, EDIJobItemLogID, BusinessUnitID)
Return p.ProcessEDI(True, False)
ElseIf ediFileGroupAbbr = "FOPDSINV" Then
[code]...
to which I'm passing in a value of ediFileGroupAbbr = "FOPDSINV". But the code is executing as if it's dropping into the third condition (p is a PrivateBillingAdapter). So I've stepped into the code and, sure enough, it drops into the second condition. BUT, if I step into the execution of the constructor, the debugger jumps to an odd place in the code - sort of the middle of a method and not on any actual line of code.A couple clicks and it hops back out of the constructor, still in the second block of code. But if I mouse over the variable p to see it's type, boom, its a PrivateBillingAdapter (from the third block).Like I said, something is clearly wrong but I don't know what. I've tried rebuilding several times but with no new results.This is VS2003, framework 1.1 with VB.NET.
View 1 Replies
Dec 31, 2009
What i am tring to do is execute certain code based on a variable held in a module someting like compiler directives, here's an example for lack of an explanation.[code]...
View 2 Replies
Mar 13, 2012
sir, i have no idea how the code will look, but i want it to assign a value after reading from a text file and then store it for further use even if the text file is not there, but without using any external storage like registry, disk, ram. It should store the value in itself and do like this:-
dim variable1, variable2 as string
if file.exists("text.txt")
read the text
[code].....
View 2 Replies
Aug 21, 2011
I'm trying to retrieve a record from access database on the basis of a string variable.
here is the code
Dim val As String( "kent")
Dim comm As Data.OleDb.OleDbCommand
comm = New Data.OleDb.OleDbCommand("select DISTINCT M_DATE_P from MACHINE_P where M_MODEL=" & val, conn)
i want to pass val variable, so that i can retrieve data at runtime.
View 3 Replies
Jun 12, 2011
Variable 'loNode' is used before it has been assigned a value. A null reference exception could result at runtime.
why I am getting this error?
Imports System.Xml
Module Module1
Sub Main()
Dim doc As New XmlDocument
[code].....
View 2 Replies
Aug 2, 2009
I want to hear some discussion regarding what is the best way to persist program parameter and variable settings from one run of the program to the next. I used to often use the ubiquitous INI type file in VB6 programs but I am aware that these are not formally supported in .Net programs. I also have a major aversion to adding to the already overwhelming bloat of the Windows registry by using that to store values.
[Code]...
View 6 Replies
Aug 27, 2009
Below is my entire code for trying to add some boolean values to a list box that are queried from a datatable called "Availability" and the value booRV which is my OleDbDatReader is "Nothing" at runtime. The error is: No value given for one or more required parameters. I assume this is all the items that are being queried, but i am not sure. Here is the code:
[code]...
View 9 Replies
Jul 18, 2012
i have a large vb.net application, i wanna analyze the performance of the program at runtime.for example, i want to know how many times a certain function was called, or the usage of computer resources for eah function?
View 1 Replies
Dec 6, 2009
Is it possible? Self modifying codes based on users choices.
View 3 Replies
Mar 11, 2010
I need to reference a .net .dll file at runtime of my program.Does anyone know the code to do it?
View 3 Replies
May 15, 2012
Let say I have the following classes[code]...
If I wanted to say, alter the code definition of the automatic property X (at runtime, perhaps in Sub New), such that I could throw the PropertyChanged event
View 2 Replies
Nov 11, 2009
I am using printer routine in vb6 like that
printer.print "Hello World!"
the string directly printed through printer with filename "microsoft visual basic". I want to change this filename at runtime using the code.
View 1 Replies
Dec 22, 2011
I am using vb.net,is it possible to change the size or place of a button at run time.I meant we can click and drag the button to increase the size or move?
View 2 Replies