Store Permanent Variable In Windows Application?
Jan 11, 2010
I'm making a windows form application using vb.net and have an options page where I need to allow users to enter a few settings, these need to be stored somewhere on the machine so that they can be found again if the program closes
View 4 Replies
ADVERTISEMENT
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
May 28, 2009
I have a query that brings back a result that I want to be able to use on all forms in my project. Is there a way to store this until the application is terminated?
For example,
I'd like to store the result of this:
Dim ssSQL As String = "SELECT ClaimNo, Custodian, Activity, Code, DateStamp FROM [Activities] WHERE "
ssSQL &= "[ClaimNo] Like ('" & txtClaimNum.Text & "')"
[Code].....
View 6 Replies
Aug 13, 2009
I am going to develop a Windows application in .net and I will be string few values. (A max of 20 values).
What is the best way of storing this? Using SQLIte seems to be a overkill.
My.Settings seem to forget the values sometimes.
What is the best way of storing these values?
is XML okay?
View 5 Replies
Jan 30, 2011
I am creating a windows application using visual studio. I want somehow to insert an excel file into the application so the user will be able to download it from the program and save it to his computer. This means that the file will be a part of the program. There will be a button that will prompt the user to save the particular file somewhere so he can then view it.
What should I do in order to "embody" the excel file to the application? And what code should I write to link the file with the button?
View 8 Replies
Feb 4, 2010
How can I store the value of a variable into another variable that wont be changed unless it meets certain criteria
View 1 Replies
Apr 14, 2009
i have 23:23:30 in a texbox and i like to store this in a variable ,if i put a variable m1 as decimal, i have a message error,if i put string , i have 0 and not 23:23:30,why?
View 11 Replies
Mar 11, 2010
How can I store the value of a variable into another variable that wont be changed unless it meets certain criteria
View 2 Replies
Jan 1, 2012
I got Minimum date from database using sql qry, And when i try to store that min.date in one variable, its getting error, PlZ help me. for below coding.
Dim qry as string
Dim Min_Date As Date
If SqlCon.State = ConnectionState.Closed Then
SqlCon.Open()
[code]....
View 2 Replies
Feb 2, 2009
Can someone give me a simple example on how can I store/appear in a variable/or a textbox a value that i retrieved from a database. The sql query is something like "Select Comment from Params where id =1".
View 5 Replies
Jun 4, 2009
Just wondering if it's possible to store a reference to an object in a variable.
I will elaborate:
[Code]...
View 5 Replies
Apr 22, 2010
Can I store the common operators such as '>', '<', '+' etc., in a variable and then use it when required.
[Code]....
so here instead of directly using > and +, Can I use the variables OP1 and OP2 somehow. May be I can put the entire string from "If..... NUM1" in another variable as text string and then execute that variable.
View 1 Replies
Nov 7, 2009
I have a program where I open files and I store the location as a variable so I can reopen them later on. It works much like MS Word does, where it shows the names on the side and when I click it and open, it will open the file. Mine is a little different because it will store large numbers of file names in a list box because people are usually going to open folders full of files. The initial way I did it had the path name stored in a list box and it would open the file using that path. I decided it was a bad idea and I tried to use just the name of the file. However, I ran into a problem with the code that I was using.
Code:
If its checked, it will open the selected item from the list box instead.
If CheckBox1.Checked = True Then
'for all the indexes of the saved location record of array, if the selected item is found, then open that file
For counter = 0 To SavedLocations.GetUpperBound(0)
[code].....
So as you can see, what I have is it decides whether you opened from the list box or not. If it is not from the list box, it opens it up fine. It adds the information to the list box and stores some information in an array so I can access it later on. If it does open from the list box, then it will search for the file name in the array. If it finds it in the array, it will proceed to open the file using the directory. There is no else clause because it should be finding it 100% of the time.
The error I get is that parameter cannot be null. Filename2 never seems to get assigned, which means it's not finding the value in the array. I've tested and the value is in the array and the values are the same values.
View 4 Replies
Feb 2, 2010
'ValueNow is updated by an external link eg ADO.NET
Dim PresentValue as Decimal
Dim PreviousValue as Decimal
[Code].....
View 6 Replies
Jan 30, 2010
I have a file which is opened and the bytes are loaded into a class.The file needs to be split into chunks, and there is a header which gives the locations and sizes of the chunks.Should I (upon opening the file) split the file into chunk sand store each chunk in an array of variables And then when I want to access the data in the chunks I just use the array.
or store all the chunks in one variable together and then when I need access to the chunks get the location and size of them and use that to find chunks each time I need to modify them.
View 1 Replies
Dec 25, 2011
Class1:
Dim v as integer
public sub storeVar(byval s as integer)
v = s
end sub
[code].....
I need to save a reference of variable s in Class2 in variable v in Class1.(i.e. when the value of s changes v also changes (and vice versa)Is this possible since vb.net doesn't have pointers?Will it work if I change "byval" to "byref"?
View 1 Replies
Mar 29, 2011
I am doing a college project for a driving instructor, so the heart of the program is getting the booking part right. I've made a structure in a module:
[Code]...
View 10 Replies
Jul 18, 2011
I would like to store a plain text logfile (approx 6 - 30 kB) in a variable belonging to a class that I later serialize. One way to do it is obviously reading it in and storing it to a string.
View 3 Replies
Dec 2, 2009
Try to store hex value D9 to byte variable.
Dim x As Byte
x = encText.GetBytes(&HD9)
When Debug.Print for check, answer show hex 83 (decimal 131). Why it cannot store correct hex value?
View 2 Replies
Sep 27, 2010
Is it possible to detect when any button on a form is clicked and then store that buttons name in a variable?
My reason for wanting to do this is because i have over 700 buttons in my form and each one needs to do something different. I want to create one sub with if statements to respond to all button clicks.
View 17 Replies
May 21, 2010
I'm looking to store the result of SQL count function in a variable, i've tried numerous ways but haven't managed to get it to work?
View 3 Replies
Oct 11, 2011
Im trying to get the result of an SQL statement and store it in an integer variable "count" in vb so it can then be displayed on my website showing the user the total Open records:SELECT COUNT (recordID) FROM [tbl_Records] WHERE [Status] = 'Open'
View 2 Replies
Oct 18, 2010
How to store today's date in a variable?
View 3 Replies
Oct 13, 2009
I am using VB.net Code.I have got below string
[URL]
Now I want to split above string with "/" as well I want to store value SearchTrainerData.aspx in a variable In my case
Dim str as String
str = "SearchTrainerData.aspx"
give my the code which will split the above string further store it in a variable?
View 5 Replies
Jul 12, 2010
My application sends information from Form1 to Form2 by means of a global variable on Form1 whose value is read by Form2.
This variable is basically used to tell Form2 what it has to do because it's value will change depending on different conditions.
All form2 is meant to do is load data from a database into DataSets which will "ported" to Form1 (the main form) for consumption. I use a Form for this rather than a class because there's a lot of data that will be loaded each time it's visible and I wanted[code]...
View 6 Replies
Mar 19, 2009
I'm traying to write some query but I don't know much about DataBase. I have a variable that store the value entered on a textbox and I want to look value in the DataBase and then show the record on the DataGrid. I'm traying to build some query but I think I'm way off.
Here is my query:
SELECT Name, Record, Plan, [Numero de contrato]
FROM [Record de Pacientes]
WHERE (Name LIKE '%Variable%')
View 9 Replies
Sep 25, 2010
I have added a progress bar user control which I downloaded to my project. The code follows:Public Class UC_PBar Define a variable to store the current percentage of the bar, to save use recalculating
[Code]...
View 2 Replies
Jan 28, 2010
I have a config.txt file that has the following lines in it.
[MUSIC_PATH]=X:MultimediaAudio
[MOVIES_PATH]=X:MultimediaVideosMovies
[SHOWS_PATH]=X:MultimediaVideosTV Shows
[code].....
View 3 Replies
Oct 27, 2009
In the application I'm documenting, sometimes a value is stored in a Public variable & other times it's passed to/from a Public Property which does nothing except store it in/retrieve it from a Private variable. (And in one memorable exception, the Public Property stored it in a Public variable-I'm almost certain that was an oversight by the original programmer though.)
I know that passing it to/from the Public Property has the potential for better validation, but if the Property doesn't actually do anything except store/retrieve it is there any benefit to declaring it as a Property? (Or maybe I should put that the other way around. Personally I'd declare them all as properties because that will allow adding validation later-but I'm not rewriting this, I'm just trying to document it and, in this case, trying to figure out why sometimes it's done as a property & sometimes as a Public variable.)
View 2 Replies
Jul 12, 2011
Which is the best way to store application and user settings of an application running with multiple instances?My problem is that using the vb's "Application Settings" one instance would overwrite the other one.I want to identify each instance with a number passed via command line argument. I could use this number to identify the appropriate settings of the running instance, but I see in a local INI o XML file a better way to handle that.
View 1 Replies